orderInformation.vue 8.3 KB

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