detail.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <view class="container-detail">
  3. <navbar :config="config" backColor="#666666"></navbar>
  4. <view class="header">
  5. <view class="box"><text class="label">订单号:</text>{{orderDetail.order_code}}</view>
  6. <view class="box"><text class="label">会员名称:</text>{{orderDetail.user_name}}</view>
  7. <view class="box"><text class="label">手机号:</text>{{orderDetail.user_mobile}}</view>
  8. </view>
  9. <view class="jg"></view>
  10. <view class="body">
  11. <view class="shop zflex" v-if="orderDetail.shop_entity">
  12. <image class="logo" :src="orderDetail.shop_entity.logo" mode="aspectFill"></image>
  13. <view class="shop-info">
  14. <view class="title">{{orderDetail.shop_name}}</view>
  15. <view class="address zflex">
  16. <view class="address-info zflex">
  17. <image class="address-img" src="/static/shop/location-icon.png" mode="widthFix"></image>
  18. <view class="address-text">{{orderDetail.shop_entity.map_punctuation || '暂无商户地址' }}</view>
  19. </view>
  20. <view class="location-to zflex" @click="toShop">
  21. <view class="iconfont3 to-icon">&#xe787;</view>
  22. <view class="">去逛逛</view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="ifno">
  28. <view class="box"><text class="label">消费金额:</text>¥{{orderDetail.sales_money}}</view>
  29. <view class="box"><text class="label">打赏比例:</text>{{orderDetail.discount_ratio}}%</view>
  30. <view class="box"><text class="label">打赏金额:</text>¥{{orderDetail.discount_money}}</view>
  31. <view class="box"><text class="label">付款方式:</text>{{getPayLabel(orderDetail.pay_mode)}}</view>
  32. <view class="box"><text class="label">订单备注:</text>{{orderDetail.remark || '暂无备注'}}</view>
  33. <view class="box"><text class="label">上报时间:</text>{{orderDetail.create_time && orderDetail.create_time.replace(/-/g, '.')}}</view>
  34. </view>
  35. </view>
  36. <view class="jg"></view>
  37. <view class="contribution-box">
  38. <view class="box" v-if="!isMine"><text class="label">商家获得贡献值:</text>{{orderDetail.give_shop_commission_able}}
  39. </view>
  40. <view class="box"><text class="label">用户获得贡献值:</text>{{orderDetail.give_user_commission_able}}</view>
  41. <view class="box" v-if="!isMine"><text class="label">商家打赏积分数:</text>{{orderDetail.shop_consume_integral_able}}
  42. </view>
  43. </view>
  44. <view class="jg" v-if="orderDetail.member_comments"></view>
  45. <view class="contribution-box" v-if="isMine && orderDetail.member_comments">
  46. <view class="box"><text class="label">评分:</text>
  47. <u-rate :count="5" v-model="orderDetail.member_comments.level" inactive-color="#cccccc" active-color="#FFC336"
  48. disabled></u-rate>
  49. </view>
  50. <view class="box"><text class="label">评价:</text>{{orderDetail.member_comments.content || '无'}}</view>
  51. <view class="box"><text class="label">评价时间:</text>{{orderDetail.member_comments.create_time.replace(/-/g, '.')}}</view>
  52. </view>
  53. <view class="footer" v-if="isMine && !orderDetail.member_comments">
  54. <view class="btn" @click="toComment">去评价</view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. config: {
  63. back: true,
  64. title: '订单详情',
  65. color: '#1A1A1A',
  66. backgroundColor: [1, "#fff"],
  67. statusBarFontColor: '#1A1A1A',
  68. leftSlot: true
  69. },
  70. orderDetail: {},
  71. payList: [{
  72. code: 'WE_CHAT',
  73. name: '微信',
  74. id: 0
  75. },
  76. {
  77. code: 'ALIPAY',
  78. name: '支付宝',
  79. id: 1
  80. },
  81. {
  82. code: 'MONEY',
  83. name: '现金',
  84. id: 2
  85. },
  86. {
  87. code: 'WE_CHAT_MONEY',
  88. name: '微信+现金',
  89. id: 3
  90. },
  91. {
  92. code: 'ALIPAY_MONEY',
  93. name: '支付宝+现金',
  94. id: 4
  95. },
  96. {
  97. code: 'OTHER',
  98. name: '其他支付',
  99. id: 5
  100. }
  101. ],
  102. isMine: true
  103. }
  104. },
  105. computed: {
  106. getPayLabel() {
  107. return (pay_mode) => {
  108. for (let item of this.payList) {
  109. if (item.id == pay_mode) {
  110. return item.name
  111. }
  112. }
  113. }
  114. }
  115. },
  116. onLoad(options) {
  117. if (options && options.orderId && options.isMine) {
  118. this.orderId = options.orderId
  119. this.isMine = options.isMine == 'true' ? true : false
  120. this.getOrderDetail(options.orderId)
  121. }
  122. },
  123. methods: {
  124. getOrderDetail(id) {
  125. this.$http.get(`/offlineorder/info/${id}`).then(res => {
  126. if (res.code == 200) {
  127. this.orderDetail = res.data
  128. }
  129. })
  130. },
  131. toComment() {
  132. uni.redirectTo({
  133. url: `/pages/workbench/order/comment?orderId=${this.orderId}&orderNo=${this.orderDetail.order_code}`
  134. })
  135. },
  136. toShop() {
  137. uni.navigateTo({
  138. url: `/pages/nearbyShop/shopDetail?shopId=${this.orderDetail.shop_id}`
  139. })
  140. },
  141. },
  142. }
  143. </script>
  144. <style lang="scss" scoped>
  145. .container-detail {
  146. font-size: 28rpx;
  147. font-family: PingFang SC, PingFang SC-Regular;
  148. font-weight: 400;
  149. color: #808080;
  150. .box {
  151. margin-bottom: 10rpx;
  152. }
  153. .label {
  154. color: #1A1A1A;
  155. }
  156. .jg {
  157. height: 10rpx;
  158. background: #f5f5f5;
  159. }
  160. .zflex {
  161. display: flex;
  162. align-items: center;
  163. }
  164. .header {
  165. width: 100%;
  166. padding: 48rpx 30rpx 30rpx;
  167. background-color: #fff;
  168. .box:last-child {
  169. margin-bottom: 0;
  170. }
  171. }
  172. .body {
  173. padding: 30rpx;
  174. .shop {
  175. height: 158rpx;
  176. margin-bottom: 30rpx;
  177. .logo {
  178. width: 162rpx;
  179. height: 158rpx;
  180. margin-right: 36rpx;
  181. border-radius: 20rpx;
  182. flex-shrink: 0;
  183. }
  184. .shop-info {
  185. flex: 1;
  186. width: 0;
  187. .title {
  188. margin-bottom: 27rpx;
  189. color: #333333;
  190. font-size: 28rpx;
  191. font-family: PingFang SC, PingFang SC-Bold;
  192. font-weight: 700;
  193. }
  194. .address {
  195. justify-content: space-between;
  196. .address-info {
  197. flex: 1;
  198. width: 0;
  199. margin-right: 10rpx;
  200. .address-img {
  201. width: 26rpx;
  202. height: 36rpx;
  203. margin-right: 14rpx;
  204. flex-shrink: 0;
  205. }
  206. .address-text {
  207. overflow: hidden;
  208. text-overflow: ellipsis;
  209. white-space: nowrap;
  210. }
  211. }
  212. .location-to {
  213. flex-shrink: 0;
  214. .to-icon {
  215. font-size: 36rpx;
  216. color: #4581F6;
  217. }
  218. }
  219. }
  220. }
  221. }
  222. .ifno {
  223. .box:last-child {
  224. margin-bottom: 0;
  225. }
  226. }
  227. }
  228. .contribution-box {
  229. padding: 30rpx;
  230. }
  231. .footer {
  232. width: 100%;
  233. padding: 30rpx 60rpx;
  234. position: fixed;
  235. bottom: 0;
  236. display: flex;
  237. align-items: center;
  238. justify-content: space-between;
  239. background-color: #fff;
  240. .btn {
  241. width: 100%;
  242. color: #fff;
  243. text-align: center;
  244. line-height: 85rpx;
  245. border: 1rpx solid #3775F6;
  246. border-radius: 44rpx;
  247. background-color: #FA6138;
  248. font-size: 28rpx;
  249. font-family: PingFang SC, PingFang SC-Regular;
  250. font-weight: 400;
  251. text-align: center;
  252. }
  253. .online-btn {
  254. color: #FA6138;
  255. border: 1rpx solid #3775F6;
  256. background-color: #e7eefc;
  257. }
  258. }
  259. }
  260. </style>