orderInformation.vue 8.4 KB

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