orderInformation.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <template name="information">
  2. <view class="information-template">
  3. <!-- 订单信息 -->
  4. <view class="information-content">
  5. <view class="information-view">
  6. <view class="view-num time">
  7. <view class="view-num-label">订单编号:</view>
  8. <view class="view-num-text">
  9. {{orderData.orderSn =='undefined' ? '' : orderData.orderSn}}
  10. <text class="clipboard" @click="clipboard(orderData.orderSn)">复制</text>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="information-view">
  15. <view class="view-num time">
  16. <view class="view-num-label">发货单流水号:</view>
  17. <view class="view-num-text">
  18. {{orderData.createTime}}
  19. </view>
  20. </view>
  21. </view>
  22. <view class="information-view">
  23. <view class="view-num time">
  24. <view class="view-num-label">用户账号:</view>
  25. <view class="view-num-text">
  26. {{orderData.memberUsername}}
  27. </view>
  28. </view>
  29. </view>
  30. <view class="information-view">
  31. <view class="view-num time">
  32. <view class="view-num-label">支付方式:</view>
  33. <view class="view-num-text">
  34. {{orderData.payType | formatPayType}}
  35. </view>
  36. </view>
  37. </view>
  38. <view class="information-view">
  39. <view class="view-num time">
  40. <view class="view-num-label">订单来源:</view>
  41. <view class="view-num-text">
  42. {{orderData.sourceType | formatSourceType}}
  43. </view>
  44. </view>
  45. </view>
  46. <view class="information-view">
  47. <view class="view-num time">
  48. <view class="view-num-label">订单类型:</view>
  49. <view class="view-num-text">
  50. {{orderData.orderType | formatOrderType}}
  51. </view>
  52. </view>
  53. </view>
  54. <view class="information-view">
  55. <view class="view-num time">
  56. <view class="view-num-label">配送方式:</view>
  57. <view class="view-num-text">
  58. {{orderData.deliveryCompany | formatNull}}
  59. </view>
  60. </view>
  61. </view>
  62. <view class="information-view">
  63. <view class="view-num time">
  64. <view class="view-num-label">物流单号:</view>
  65. <view class="view-num-text">
  66. {{orderData.deliverySn | formatNull}}
  67. </view>
  68. </view>
  69. </view>
  70. <view class="information-view">
  71. <view class="view-num time">
  72. <view class="view-num-label">自动确认收货时间:</view>
  73. <view class="view-num-text">
  74. {{orderData.autoConfirmDay}}天
  75. </view>
  76. </view>
  77. </view>
  78. <view class="information-view">
  79. <view class="view-num time">
  80. <view class="view-num-label">订单可得优币:</view>
  81. <view class="view-num-text">
  82. {{orderData.integration}}
  83. </view>
  84. </view>
  85. </view>
  86. <view class="information-view">
  87. <view class="view-num time">
  88. <view class="view-num-label">订单可得成长值:</view>
  89. <view class="view-num-text">
  90. {{orderData.growth}}
  91. </view>
  92. </view>
  93. </view>
  94. <view class="information-view">
  95. <view class="view-num time">
  96. <view class="view-num-label">活动信息:</view>
  97. <view class="view-num-text">
  98. {{orderData.promotionInfo | formatLongText}}
  99. </view>
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. </template>
  105. <script>
  106. const thorui = require("@/components/clipboard/clipboard.thorui.js")
  107. export default{
  108. name:"information",
  109. props:{
  110. orderInfo:{
  111. type:Object
  112. }
  113. },
  114. data() {
  115. return{
  116. orderData:'',
  117. payTotalFee:'',
  118. balancePayFee:'',
  119. freight:'',
  120. discountFee:'',
  121. freePostFlag:'',
  122. payableAmount:'',
  123. pendingPayments:'',
  124. receiptAmount:'',
  125. expensesOfTaxation:'',
  126. }
  127. },
  128. created(){
  129. this.initData(this.orderInfo)
  130. },
  131. filters: {
  132. formatNull(value) {
  133. if(value===undefined||value===null||value===''){
  134. return '暂无';
  135. }else{
  136. return value;
  137. }
  138. },
  139. formatLongText(value) {
  140. if(value===undefined||value===null||value===''){
  141. return '暂无';
  142. }else if(value.length>8){
  143. return value.substr(0, 8) + '...';
  144. }else{
  145. return value;
  146. }
  147. },
  148. formatPayType(value) {
  149. if (value === 1) {
  150. return '支付宝';
  151. } else if (value === 2) {
  152. return '微信';
  153. } else {
  154. return '未支付';
  155. }
  156. },
  157. formatSourceType(value) {
  158. if (value === 1) {
  159. return 'APP订单';
  160. } else {
  161. return 'PC订单';
  162. }
  163. },
  164. formatOrderType(value) {
  165. if (value === 1) {
  166. return '秒杀订单';
  167. } else {
  168. return '正常订单';
  169. }
  170. },
  171. formatAddress(order) {
  172. let str = order.receiverProvince;
  173. if (order.receiverCity != null) {
  174. str += " " + order.receiverCity;
  175. }
  176. str += " " + order.receiverRegion;
  177. str += " " + order.receiverDetailAddress;
  178. return str;
  179. },
  180. formatPayStatus(value) {
  181. if (value === 0) {
  182. return '未支付';
  183. } else if(value===4){
  184. return '已退款';
  185. }else{
  186. return '已支付';
  187. }
  188. },
  189. formatDeliverStatus(value) {
  190. if (value === 0||value === 1) {
  191. return '未发货';
  192. } else {
  193. return '已发货';
  194. }
  195. },
  196. },
  197. computed: {
  198. },
  199. watch:{
  200. orderInfo:{
  201. handler:function(val){
  202. this.initData(val)
  203. },
  204. deep:true//对象内部的属性监听,也叫深度监听
  205. }
  206. },
  207. methods:{
  208. initData(res) {
  209. this.orderData = res;
  210. },
  211. clipboard(data) {
  212. thorui.getClipboardData(data, (res) => {
  213. if (res) {
  214. this.$util.msg("复制成功",2000);
  215. } else {
  216. this.$util.msg("复制失败",2000);
  217. }
  218. })
  219. },
  220. toFiexdFn(n){
  221. let num
  222. if(n==null){
  223. num='0.00'
  224. }else{
  225. num = n.toFixed(2)
  226. }
  227. return num
  228. }
  229. }
  230. }
  231. </script>
  232. <style lang="scss">
  233. .information-template{
  234. width: 100%;
  235. height: auto;
  236. background: #FFFFFF;
  237. float: left;
  238. margin-top: 16rpx;
  239. .information-content{
  240. width: 100%;
  241. padding: 20rpx 24rpx;
  242. .information-view{
  243. height: 50rpx;
  244. line-height: 50rpx;
  245. font-size: $font-size-28;
  246. color: $text-color;
  247. margin: 4rpx 0;
  248. display: flex;
  249. .view-num{
  250. flex: 1;
  251. color: $text-color;
  252. text-align: left;
  253. .view-num-label{
  254. text-align: left;
  255. float: left;
  256. color: $text-color;
  257. }
  258. .view-num-text{
  259. float: left;
  260. text-align: left;
  261. color: #999999;
  262. }
  263. }
  264. .view-num.ord{
  265. color: $color-system;
  266. text-align: left;
  267. flex:3;
  268. font-weight: bold;
  269. }
  270. .view-num.time{
  271. color: #999999;
  272. }
  273. .bold{
  274. font-weight: bold;
  275. }
  276. .red{
  277. color: #FF2A2A;
  278. }
  279. .view-type{
  280. float: right;
  281. text-align: right;
  282. color: #FF2A2A;
  283. flex: 2;
  284. }
  285. .clipboard{
  286. width: 84rpx;
  287. height: 36rpx;
  288. background: #EBEBEB;
  289. text-align: center;
  290. font-size: $font-size-24;
  291. color: #999999;
  292. border-radius: 18rpx;
  293. line-height: 36rpx;
  294. display: inline-block;
  295. margin-left: 42rpx;
  296. }
  297. }
  298. }
  299. }
  300. </style>