orderInformation.vue 6.9 KB

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