hisOrderDetail.vue 7.6 KB

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