orderInformation.vue 8.2 KB

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