orderInformation.vue 7.0 KB

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