orderInformation.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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. // #ifdef H5
  119. if (res) {
  120. this.$util.msg("复制成功",2000);
  121. } else {
  122. this.$util.msg("复制失败",2000);
  123. }
  124. // #endif
  125. })
  126. },
  127. toFiexdFn(n){
  128. let num
  129. if(n==null){
  130. num='0.00'
  131. }else{
  132. num = n.toFixed(2)
  133. }
  134. return num
  135. }
  136. }
  137. }
  138. </script>
  139. <style lang="scss">
  140. .information-template{
  141. width: 100%;
  142. height: auto;
  143. background: #FFFFFF;
  144. float: left;
  145. margin-top: 24rpx;
  146. .information-content{
  147. width: 702rpx;
  148. padding: 20rpx 24rpx;
  149. .information-view{
  150. height: 50rpx;
  151. line-height: 50rpx;
  152. font-size: $font-size-28;
  153. color: $text-color;
  154. margin: 4rpx 0;
  155. display: flex;
  156. view{
  157. flex: 1;
  158. color: $text-color;
  159. text-align: left;
  160. }
  161. .view-num{
  162. .bage-buss{
  163. display: block;
  164. float: left;
  165. width: 64rpx;
  166. height: 30rpx;
  167. background:linear-gradient(132deg,rgba(255,177,0,1) 0%,rgba(255,127,0,1) 100%);
  168. border-radius: 6rpx;
  169. line-height: 30rpx;
  170. font-size: $font-size-24;
  171. text-align: center;
  172. color: #FFFFFF;
  173. margin-top: 10rpx;
  174. }
  175. .bage-auto{
  176. display: block;
  177. float: left;
  178. width: 64rpx;
  179. height: 30rpx;
  180. background:linear-gradient(135deg,rgba(0,216,255,1) 0%,rgba(22,139,225,1) 100%);
  181. border-radius: 6rpx;
  182. line-height: 30rpx;
  183. font-size: $font-size-24;
  184. text-align: center;
  185. color: #FFFFFF;
  186. margin-top: 10rpx;
  187. }
  188. .bage-text{
  189. font-size: $font-size-28;
  190. line-height: 40rpx;
  191. text-align: left;
  192. color: $color-system;
  193. margin-left: 15rpx;
  194. }
  195. }
  196. .view-num.ord{
  197. color: $color-system;
  198. text-align: left;
  199. flex:3;
  200. font-weight: bold;
  201. }
  202. .view-num.time{
  203. color: #999999;
  204. flex: 6;
  205. }
  206. .bold{
  207. font-weight: bold;
  208. }
  209. .red{
  210. color: #FF2A2A;
  211. }
  212. .view-type{
  213. float: right;
  214. text-align: right;
  215. color: #FF2A2A;
  216. flex:4;
  217. }
  218. .clipboard{
  219. width: 84rpx;
  220. height: 36rpx;
  221. background: linear-gradient(34deg,rgba(255,41,41,1) 0%,rgba(255,109,27,1) 100%);
  222. text-align: center;
  223. font-size: $font-size-24;
  224. color: #FFFFFF;
  225. border-radius: 6rpx;
  226. line-height: 36rpx;
  227. display: inline-block;
  228. margin-left: 42rpx;
  229. }
  230. }
  231. }
  232. }
  233. </style>