hisOrderDetail.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. <template>
  2. <view class="order-pages">
  3. <v-select v-show="false" ref="rubbishType" placeholder="" code="RESERVE_RUBBISH_TYPE" style="width: 100%"></v-select>
  4. <view class="order-info">
  5. <!-- 订单状态 -->
  6. <view class="order-status">
  7. <view class="status-title flex align_center justify_center">
  8. <u-icon v-if="orderInfo.orderStatusDictValue=='已完成'" class="icon" name="prescription_order_icon_success"
  9. custom-prefix="custom-icon" size="48" color="#333333"></u-icon>
  10. <u-icon v-if="orderInfo.orderStatus=='CANCEL'" class="icon" name="prescription_order_icon_cancel"
  11. custom-prefix="custom-icon" size="48" color="#333333"></u-icon>
  12. <!-- <view class="t-icon icon t-icon-icon_complete"></view> -->
  13. <view class="t-icon icon t-icon-prescription_order_icon_cancel"></view>
  14. {{orderInfo.orderStatusDictValue || '--'}}
  15. </view>
  16. <view class="status-care">
  17. 预约时间:{{orderInfo.reserveTime}}
  18. </view>
  19. </view>
  20. <!-- 服务信息 -->
  21. <view class="info-main flex flex_column">
  22. <view class="flex flex_1 align_center">
  23. <view class="new-left ellipsis-two">
  24. {{orderInfo.contactAddress || '--'}}
  25. </view>
  26. </view>
  27. <view class="time flex align_center justify_between">
  28. <text>{{orderInfo.contactName}}</text>
  29. <view class="flex align_center">
  30. <u-icon class="phone" name="icon_phone" custom-prefix="custom-icon" size="28" color="#999999"></u-icon>
  31. <text>{{orderInfo.contactMobile}}</text>
  32. </view>
  33. </view>
  34. </view>
  35. <!-- 预约信息 -->
  36. <view class="item-info">
  37. <view class="item flex justify_between">
  38. <text>预约品类</text>
  39. <text>{{typeNames}}</text>
  40. </view>
  41. <view class="item flex justify_between">
  42. <text>预约重量</text>
  43. <text>{{orderInfo.reserveWeight}}</text>
  44. </view>
  45. </view>
  46. <!-- 订单信息 -->
  47. <view class="item-info">
  48. <view class="item flex justify_between">
  49. <text>订单编号</text>
  50. <text>{{orderInfo.orderReserveNo||'--'}}</text>
  51. </view>
  52. <view class="item flex justify_between">
  53. <text>下单时间</text>
  54. <text>{{orderInfo.createDate}}</text>
  55. </view>
  56. <view v-if="orderInfo.orderStatus!='CANCEL'" class="item flex justify_between">
  57. <text>服务时间</text>
  58. <text>{{orderInfo.finishDate || '--'}}</text>
  59. </view>
  60. <view v-if="orderInfo.orderStatus=='CANCEL'" class="item flex justify_between">
  61. <text>取消原因</text>
  62. <text>{{orderInfo.cancelReason || '--'}}</text>
  63. </view>
  64. </view>
  65. <!-- 回收品类明细 -->
  66. <view v-if="typeData.length" class="item-info">
  67. <view class="item-title flex justify_between">
  68. <text>回收品类明细</text>
  69. </view>
  70. <view class="item flex">
  71. <view :class="['item-type', curType == item.code ? 'active' : '']" v-for="(item,index) in typeData" :key="item.id" @click="curIndex=index" >
  72. {{item.name}}
  73. </view>
  74. </view>
  75. <view v-for="item in typeData[curIndex].typeList" :key="item.id" class="item flex justify_between">
  76. <text>{{item.typeName || '--'}} {{item.rubbishPrice || 0}}元/kg</text>
  77. <text>{{item.rubbishWeight/1000 || 0}}kg/{{item.totalAmount || 0}}元</text>
  78. </view>
  79. </view>
  80. <!-- 金额 -->
  81. <view class="item-info">
  82. <view class="item flex justify_between">
  83. <text>应付金额</text>
  84. <text>{{orderInfo.originaAmount||0}} 元</text>
  85. </view>
  86. <view class="item flex justify_between">
  87. <text>支付方式</text>
  88. <text>{{orderInfo.payTypeDictValue}}</text>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </template>
  94. <script>
  95. import moment from 'moment'
  96. import { orderDetailFind } from '@/api/order.js'
  97. import vSelect from '@/components/select/v-select.vue'
  98. export default {
  99. components: {
  100. vSelect
  101. },
  102. data() {
  103. return {
  104. orderInfo: {},
  105. orderReserveNo: '', // 订单no
  106. typeData: [], // 订单包含类型数据
  107. typeNames: '', // 预约品类名称
  108. curIndex: 0 // 当前类型下标
  109. }
  110. },
  111. onLoad(options) {
  112. if (options.orderNo) {
  113. console.log(options.orderNo)
  114. this.orderReserveNo = options.orderNo
  115. this.getOrderDetail()
  116. }
  117. // 开启分享
  118. uni.showShareMenu({
  119. withShareTicket: true,
  120. menus: ['shareAppMessage', 'shareTimeline']
  121. })
  122. },
  123. computed: {
  124. },
  125. methods: {
  126. // 获取订单详情
  127. getOrderDetail() {
  128. uni.showLoading({
  129. title: '加载中...'
  130. })
  131. this.typeData = []
  132. this.typeNames = ''
  133. orderDetailFind({
  134. orderReserveNo: this.orderReserveNo
  135. }).then(res => {
  136. console.log(res,'rrrrrrrr')
  137. if (res.status == 200) {
  138. this.orderInfo = res.data
  139. this.orderInfo.reserveTime = moment(this.orderInfo.confirmDate).format('YYYY-MM-DD') + this.orderInfo.reserveTimeTypeDictValue
  140. let data = this.$refs.rubbishType.getDataList()
  141. // 重组类型数据
  142. if(this.orderInfo.orderReserveItemEntityList) {
  143. data.map(k =>{
  144. let arr = this.orderInfo.orderReserveItemEntityList.filter(item=>{
  145. return item.rubbishType == k.code
  146. })
  147. console.log(arr,'dddd')
  148. if(arr.length) {
  149. let p = {
  150. typeCode: k.code,
  151. name: k.dispName,
  152. typeList: arr
  153. }
  154. this.typeData.push(p)
  155. console.log(p,this.typeData,'pppppp')
  156. }
  157. })
  158. this.typeData.map(item=>{
  159. this.typeNames = (this.typeNames ? (this.typeNames + ','):'') + item.name
  160. })
  161. }
  162. }
  163. uni.hideLoading()
  164. })
  165. },
  166. },
  167. }
  168. </script>
  169. <style lang="scss">
  170. .order-pages {
  171. width: 100%;
  172. height: 100vh;
  173. display: flex;
  174. flex-direction: column;
  175. background-color: #F5F5F5;
  176. .order-info {
  177. width: 100%;
  178. flex: 1;
  179. overflow-y: scroll;
  180. // 订单内容
  181. .info-main{
  182. background: #ffffff;
  183. padding: 10upx 32upx;
  184. margin: 20upx 32upx;
  185. border-radius: 24upx;
  186. box-shadow: 1px 1px 3px #EEEEEE;
  187. font-size: 28upx;
  188. background-image: url(../../static/order_bg_stor.png);
  189. background-repeat: no-repeat;
  190. height: 260rpx;
  191. .new-left{
  192. width: 360rpx;
  193. font-size: 36rpx;
  194. color: #191919;
  195. font-weight: 600;
  196. line-height: 44rpx;
  197. margin-top: 30rpx;
  198. }
  199. .time{
  200. padding: 20rpx 0;
  201. font-size: 32rpx;
  202. color: #7C7D7E;
  203. margin-top: 20rpx;
  204. view:last-child{
  205. font-size: 28rpx;
  206. color: #4C4C4C;
  207. margin-left: 6rpx;
  208. }
  209. }
  210. }
  211. // 状态
  212. .order-status {
  213. padding: 30upx 0;
  214. text-align: center;
  215. .status-title {
  216. font-size: 42upx;
  217. color: #191919;
  218. .icon{
  219. width: 48rpx;
  220. height: 48rpx;
  221. margin-right: 10rpx;
  222. }
  223. }
  224. .status-care {
  225. font-size: 28upx;
  226. margin-top: 10upx;
  227. color: #191919;
  228. >text {
  229. color: red;
  230. }
  231. }
  232. }
  233. // 订单信息列
  234. .item-info{
  235. border-radius: 24rpx;
  236. margin: 0rpx 32rpx 20rpx;
  237. padding: 0rpx 32rpx;
  238. background-color: #fff;
  239. .item-title{
  240. font-size: 32rpx;
  241. color: #181818;
  242. padding-top: 28rpx;
  243. }
  244. .item{
  245. padding: 28rpx 0;
  246. font-size: 32rpx;
  247. border-bottom: 1px solid #EBEBEB;
  248. :first-child{
  249. color: #7C7D7E;
  250. }
  251. :last-child-child{
  252. color: #222222;
  253. }
  254. &:last-child{
  255. border-bottom: none;
  256. }
  257. .item-type{
  258. padding: 0 20rpx;
  259. height: 56rpx;
  260. border: 1px solid #979797;
  261. opacity: 1;
  262. border-radius: 28rpx;
  263. font-size: 24rpx;
  264. color: #999999;
  265. text-align: center;
  266. line-height: 56rpx;
  267. margin-right: 20rpx;
  268. }
  269. .item-type.active{
  270. background-color: #4F88F7;
  271. border: none;
  272. color: #fff;
  273. }
  274. }
  275. }
  276. .price-text {
  277. font-size: 20upx;
  278. margin-left: 10upx;
  279. }
  280. .price-num {
  281. font-size: 32upx;
  282. color: red;
  283. font-weight: 600;
  284. margin-right: 6rpx;
  285. }
  286. .u-cell {
  287. padding: 10rpx 32rpx;
  288. }
  289. }
  290. .footer {
  291. padding: 20rpx 32rpx;
  292. display: flex;
  293. background-color: #fff;
  294. .btn{
  295. flex: 1;
  296. height: 84rpx;
  297. font-size: 32rpx;
  298. text-align: center;
  299. line-height: 84rpx;
  300. }
  301. .btnCancleStyle{
  302. color: #666666;
  303. background: #E5E5E5;
  304. border-radius: 60rpx 0px 0px 60rpx;
  305. }
  306. .btnPayStyle{
  307. color: #191919;
  308. background: #FFD100;
  309. border-radius: 0rpx 60px 60px 0rpx;
  310. }
  311. .useBtn{
  312. width: 100%;
  313. height: 84rpx;
  314. font-size: 32rpx;
  315. text-align: center;
  316. line-height: 84rpx;
  317. color: #191919;
  318. background: #FFD100;
  319. border-radius: 60rpx
  320. }
  321. }
  322. }
  323. </style>