orderInformation.vue 6.9 KB

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