hisOrderDetail.vue 8.0 KB

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