orderInformation.vue 7.1 KB

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