orderInformation.vue 5.0 KB

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