orderInformation.vue 5.0 KB

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