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.orderStatus=='finish'" 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. {{orderInfo.orderStatusDictValue || '--'}}
  14. </view>
  15. <view class="status-care">
  16. 预约时间:{{orderInfo.reserveTime}}
  17. </view>
  18. </view>
  19. <!-- 服务信息 -->
  20. <view class="info-main flex flex_column">
  21. <view class="flex flex_1 align_center">
  22. <view class="new-left">
  23. {{orderInfo.contactAddress +(orderInfo.houseAddress||'')}}
  24. </view>
  25. </view>
  26. <view class="time flex align_center justify_between">
  27. <text>{{orderInfo.contactName}}</text>
  28. <view class="flex align_center">
  29. <u-icon class="phone" name="icon_phone" custom-prefix="custom-icon" size="28" color="#999999"></u-icon>
  30. <text>{{orderInfo.contactMobile}}</text>
  31. </view>
  32. </view>
  33. </view>
  34. <!-- 预约信息 -->
  35. <view class="item-info">
  36. <view class="item flex justify_between">
  37. <text>预约品类</text>
  38. <text>{{orderInfo.reserveRubbishType}}</text>
  39. </view>
  40. <view class="item flex justify_between">
  41. <text>预约重量</text>
  42. <text>{{orderInfo.reserveWeightDictValue}}</text>
  43. </view>
  44. </view>
  45. <!-- 订单信息 -->
  46. <view class="item-info">
  47. <view class="item flex justify_between">
  48. <text>订单编号</text>
  49. <text>{{orderInfo.orderReserveNo||'--'}}</text>
  50. </view>
  51. <view class="item flex justify_between">
  52. <text>下单时间</text>
  53. <text>{{orderInfo.createDate}}</text>
  54. </view>
  55. <view v-if="orderInfo.orderStatus!='CANCEL'" class="item flex justify_between">
  56. <text>服务时间</text>
  57. <text>{{orderInfo.finishDate || '--'}}</text>
  58. </view>
  59. <view v-if="orderInfo.orderStatus=='CANCEL'" class="item flex justify_between">
  60. <text>取消原因</text>
  61. <text>{{orderInfo.cancelReason || '--'}}</text>
  62. </view>
  63. </view>
  64. <!-- 回收品类明细 -->
  65. <view v-if="typeData.length" class="item-info">
  66. <view class="item-title flex justify_between">
  67. <text>回收品类明细</text>
  68. </view>
  69. <view class="item flex">
  70. <view :class="['item-type', curIndex == index ? 'active' : '']" v-for="(item,index) in typeData" :key="item.id" @click="curIndex=index" >
  71. {{item.name}}
  72. </view>
  73. </view>
  74. <view v-for="item in typeData[curIndex].typeList" :key="item.id" class="item flex justify_between">
  75. <text>{{item.typeName || '--'}} {{item.rubbishPrice || 0}}元/kg</text>
  76. <text>{{item.rubbishWeight/1000 || 0}}kg/{{item.totalAmount || 0}}元</text>
  77. </view>
  78. </view>
  79. <!-- 金额 -->
  80. <view class="item-info">
  81. <view class="item flex justify_between">
  82. <text>应付金额</text>
  83. <text>{{orderInfo.originalAmount||0}} 元</text>
  84. </view>
  85. <view class="item flex justify_between">
  86. <text>支付方式</text>
  87. <text>{{orderInfo.payTypeDictValue}}</text>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. </template>
  93. <script>
  94. import moment from 'moment'
  95. import { orderDetailFind } from '@/api/order.js'
  96. import vSelect from '@/components/select/v-select.vue'
  97. export default {
  98. components: {
  99. vSelect
  100. },
  101. data() {
  102. return {
  103. orderInfo: {},
  104. orderReserveNo: '', // 订单no
  105. typeData: [], // 订单包含类型数据
  106. typeNames: '', // 预约品类名称
  107. curIndex: 0 // 当前类型下标
  108. }
  109. },
  110. onLoad(options) {
  111. if (options.orderNo) {
  112. console.log(options.orderNo)
  113. this.orderReserveNo = options.orderNo
  114. this.getOrderDetail()
  115. }
  116. // 开启分享
  117. uni.showShareMenu({
  118. withShareTicket: true,
  119. menus: ['shareAppMessage', 'shareTimeline']
  120. })
  121. },
  122. computed: {
  123. },
  124. methods: {
  125. // 获取订单详情
  126. getOrderDetail() {
  127. uni.showLoading({
  128. title: '加载中...'
  129. })
  130. this.typeData = []
  131. this.typeNames = ''
  132. orderDetailFind({
  133. orderReserveNo: this.orderReserveNo
  134. }).then(res => {
  135. console.log(res,'rrrrrrrr')
  136. if (res.status == 200) {
  137. this.orderInfo = res.data
  138. this.orderInfo.reserveTime = moment(this.orderInfo.confirmDate).format('YYYY-MM-DD') + this.orderInfo.reserveTimeTypeDictValue
  139. let data = this.$refs.rubbishType.getDataList()
  140. // 重组类型数据
  141. if(this.orderInfo.orderReserveItemEntityList) {
  142. data.map(k =>{
  143. let arr = this.orderInfo.orderReserveItemEntityList.filter(item=>{
  144. return item.rubbishType == k.code
  145. })
  146. console.log(arr,'dddd')
  147. if(arr.length) {
  148. let p = {
  149. typeCode: k.code,
  150. name: k.dispName,
  151. typeList: arr
  152. }
  153. this.typeData.push(p)
  154. console.log(p,this.typeData,'pppppp')
  155. }
  156. })
  157. this.typeData.map(item=>{
  158. this.typeNames = (this.typeNames ? (this.typeNames + ','):'') + item.name
  159. })
  160. }
  161. }
  162. uni.hideLoading()
  163. })
  164. },
  165. },
  166. }
  167. </script>
  168. <style lang="scss">
  169. .order-pages {
  170. width: 100%;
  171. height: 100vh;
  172. display: flex;
  173. flex-direction: column;
  174. background-color: #F5F5F5;
  175. .order-info {
  176. width: 100%;
  177. flex: 1;
  178. overflow-y: scroll;
  179. // 订单内容
  180. .info-main{
  181. background: #ffffff;
  182. padding: 10upx 32upx;
  183. margin: 20upx 32upx;
  184. border-radius: 24upx;
  185. box-shadow: 1px 1px 3px #EEEEEE;
  186. font-size: 28upx;
  187. background-image: url(../../static/order_bg_stor.png);
  188. background-repeat: no-repeat;
  189. background-size: contain;
  190. .new-left{
  191. width: 360rpx;
  192. font-size: 36rpx;
  193. color: #191919;
  194. font-weight: 600;
  195. line-height: 44rpx;
  196. margin-top: 30rpx;
  197. min-height: 80rpx;
  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>