orderInformation.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template name="information">
  2. <view class="information-template">
  3. <!-- 订单信息 -->
  4. <view class="information-content">
  5. <view class="information-view num">
  6. <view class="view-num">
  7. <text class="bage-buss" v-if="orderData.orderSubmitType == 3 || orderData.orderSubmitType == 4">协销</text>
  8. <text class="bage-auto" v-if="orderData.orderSubmitType == 0 || orderData.orderSubmitType == 1 ||orderData.orderSubmitType == 2">自主</text>
  9. <text class="bage-text">订单编号:{{orderData.orderNo =='undefined' ? '' : orderData.orderNo}}</text>
  10. </view>
  11. </view>
  12. <view class="information-view">
  13. <view class="view-num time">下单时间:{{orderData.orderTime =='undefined' ? '' : orderData.orderTime}}</view>
  14. <view class="view-type">{{typeText}}</view>
  15. </view>
  16. <view class="information-view">
  17. <view class="view-num bold">
  18. 订单标识:{{orderData.orderMark =='undefined' ? '' : orderData.orderMark}}
  19. <text class="clipboard" @click="clipboard(orderData.orderMark)">复制</text>
  20. </view>
  21. </view>
  22. <view class="information-view">
  23. <view class="view-num">订单总额:¥{{payTotalFee =='undefined' ? '' : payTotalFee}}</view>
  24. <view class="view-man">余额抵扣:¥{{balancePayFee =='undefined' ? '' : balancePayFee}}</view>
  25. </view>
  26. <view class="information-view">
  27. <view class="view-num" v-if="freePostFlag == '0'">运费:包邮</view>
  28. <view class="view-num" v-if="freePostFlag == '-1'">运费:到付</view>
  29. <view class="view-num" v-if="freePostFlag == '1'">运费:¥{{freight}}</view>
  30. <view class="view-man">经理折扣:¥{{discountFee =='undefined' ? '' : discountFee}}</view>
  31. </view>
  32. <view class="information-view">
  33. <view class="view-num">税费:¥{{expensesOfTaxation == null ? '0.00' : expensesOfTaxation}}</view>
  34. <view class="view-man bold">应付总额:<text class="red">¥{{payableAmount =='undefined' ? '0.00' : payableAmount}}</text></view>
  35. </view>
  36. <view class="information-view">
  37. <view class="view-num">已支付:¥{{receiptAmount == null ? '0.00' : receiptAmount}}</view>
  38. <view class="view-man bold">待付金额:<text class="red">¥{{pendingPayments =='undefined' ? '0.00' : pendingPayments}}</text></view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. const thorui = require("@/components/clipboard/clipboard.thorui.js")
  45. export default{
  46. name:"information",
  47. props:{
  48. information:{
  49. type:Object
  50. }
  51. },
  52. data() {
  53. return{
  54. orderData:'',
  55. payTotalFee:'',
  56. balancePayFee:'',
  57. freight:'',
  58. discountFee:'',
  59. freePostFlag:'',
  60. payableAmount:'',
  61. pendingPayments:'',
  62. receiptAmount:'',
  63. typeText:'',
  64. expensesOfTaxation:'',
  65. typeTextObject:{
  66. 0:'待确认',
  67. 4:'交易完成',
  68. 5:'订单完成',
  69. 6:'已关闭',
  70. 7:'交易全退',
  71. 77:'交易全退',
  72. 11:'待付款待发货',
  73. 12:'待付款部分发货',
  74. 13:'待付款已发货',
  75. 21:'部分付款待发货',
  76. 22:'部分付款部分发货',
  77. 23:'部分付款已发货',
  78. 31:'已付款待发货',
  79. 32:'已付款部分发货',
  80. 33:'已付款已发货',
  81. 111:'待付款待发货',
  82. }
  83. }
  84. },
  85. created(){
  86. this.initData(this.information)
  87. },
  88. computed: {
  89. },
  90. watch:{
  91. information:{
  92. handler:function(val){
  93. this.initData(val)
  94. },
  95. deep:true//对象内部的属性监听,也叫深度监听
  96. }
  97. },
  98. methods:{
  99. initData(res) {
  100. this.orderData = res;
  101. this.payTotalFee =this.toFiexdFn(res.payTotalFee); //订单总额
  102. this.payableAmount =this.toFiexdFn(res.payableAmount); //应付总额
  103. this.balancePayFee = this.toFiexdFn(res.balancePayFee);
  104. this.discountFee = this.toFiexdFn(res.discountFee);
  105. this.pendingPayments = this.toFiexdFn(res.pendingPayments);
  106. this.receiptAmount = this.toFiexdFn(res.receiptAmount);
  107. this.freePostFlag = res.freePostFlag;
  108. this.freight = this.toFiexdFn(res.freight);
  109. this.expensesOfTaxation = this.toFiexdFn(res.expensesOfTaxation);
  110. Object.keys(this.typeTextObject).forEach(key => {
  111. if(key == res.status){
  112. this.typeText = this.typeTextObject[key]
  113. }
  114. })
  115. },
  116. clipboard(data) {
  117. thorui.getClipboardData(data, (res) => {
  118. if (res) {
  119. this.$util.msg("复制成功",2000,true,'success');
  120. } else {
  121. this.$util.msg("复制失败",2000,true,'none');
  122. }
  123. })
  124. },
  125. toFiexdFn(n){
  126. let num
  127. if(n==null){
  128. num='0.00'
  129. }else{
  130. num = n.toFixed(2)
  131. }
  132. return num
  133. }
  134. }
  135. }
  136. </script>
  137. <style lang="scss">
  138. .information-template{
  139. width: 100%;
  140. height: auto;
  141. background: #FFFFFF;
  142. float: left;
  143. margin-top: 24rpx;
  144. .information-content{
  145. width: 702rpx;
  146. padding: 20rpx 24rpx;
  147. .information-view{
  148. height: 50rpx;
  149. line-height: 50rpx;
  150. font-size: $font-size-28;
  151. color: $text-color;
  152. margin: 4rpx 0;
  153. display: flex;
  154. view{
  155. flex: 1;
  156. color: $text-color;
  157. text-align: left;
  158. }
  159. .view-num{
  160. .bage-buss{
  161. display: block;
  162. float: left;
  163. width: 64rpx;
  164. height: 30rpx;
  165. background:linear-gradient(132deg,rgba(255,177,0,1) 0%,rgba(255,127,0,1) 100%);
  166. border-radius: 6rpx;
  167. line-height: 30rpx;
  168. font-size: $font-size-24;
  169. text-align: center;
  170. color: #FFFFFF;
  171. margin-top: 10rpx;
  172. }
  173. .bage-auto{
  174. display: block;
  175. float: left;
  176. width: 64rpx;
  177. height: 30rpx;
  178. background:linear-gradient(135deg,rgba(0,216,255,1) 0%,rgba(22,139,225,1) 100%);
  179. border-radius: 6rpx;
  180. line-height: 30rpx;
  181. font-size: $font-size-24;
  182. text-align: center;
  183. color: #FFFFFF;
  184. margin-top: 10rpx;
  185. }
  186. .bage-text{
  187. font-size: $font-size-28;
  188. line-height: 40rpx;
  189. text-align: left;
  190. color: $color-system;
  191. margin-left: 15rpx;
  192. }
  193. }
  194. .view-num.ord{
  195. color: $color-system;
  196. text-align: left;
  197. flex:3;
  198. font-weight: bold;
  199. }
  200. .view-num.time{
  201. color: #999999;
  202. flex: 6;
  203. }
  204. .bold{
  205. font-weight: bold;
  206. }
  207. .red{
  208. color: #FF2A2A;
  209. }
  210. .view-type{
  211. float: right;
  212. text-align: right;
  213. color: #FF2A2A;
  214. flex:4;
  215. }
  216. .clipboard{
  217. width: 84rpx;
  218. height: 36rpx;
  219. background: linear-gradient(34deg,rgba(255,41,41,1) 0%,rgba(255,109,27,1) 100%);
  220. text-align: center;
  221. font-size: $font-size-24;
  222. color: #FFFFFF;
  223. border-radius: 6rpx;
  224. line-height: 36rpx;
  225. display: inline-block;
  226. margin-left: 42rpx;
  227. }
  228. }
  229. }
  230. }
  231. </style>