orderInformation.vue 7.8 KB

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