takeDetail.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. <template>
  2. <view class="padding">
  3. <!-- <view class="bg padding radius">
  4. <view class="flex">
  5. <view class="">
  6. <image src="../../static/images/place1.png" style="width: 80rpx;height: 80rpx;"></image>
  7. </view>
  8. <view class="text-white margin-left-sm">
  9. <view>欢乐<text>19999999999999</text></view>
  10. <view class="margin-top-xs">西安智能大厦</view>
  11. </view>
  12. </view>
  13. </view> -->
  14. <view class="bg padding radius">
  15. <view class=" u-flex " @click="binddetail(order)">
  16. <view class="u-m-r-10">
  17. <!-- <u-avatar :src="order.user.avatar" size="68"></u-avatar> -->
  18. <image :src="order.orderTaking.homepageImg" style="width: 140rpx;height: 140rpx;"></image>
  19. </view>
  20. <view class="u-flex-1 text-white">
  21. <view class="u-font-14 text-bold padding-bottom-xs u-line-1" style="width: 480rpx;">
  22. {{order.orderTaking.myLevel}}
  23. </view>
  24. <!-- <view class="margin-top-xs margin-bottom-xs "><text class="padding-xs text-sm">{{order.orderNumber}}</text></view> -->
  25. <view class="padding-top-xs text-lg">
  26. <text style="font-size: 20rpx;">¥</text>
  27. {{order.orderTaking.oldMoney}}元/{{order.orderTaking.unit}}<text
  28. style="font-size: 20rpx;margin-left: 10rpx;">*</text>
  29. <text style="color: #666666;">{{order.orderNumber}}{{order.orderTaking.unit}}</text>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="flex justify-between margin-top">
  34. <view style="width: 120upx;">实付款</view>
  35. <view class="text-white text-lg">
  36. <text class="text-sm">¥</text>{{price}}
  37. </view>
  38. </view>
  39. </view>
  40. <view class="bg padding radius margin-top">
  41. <view class="text-lg text-bold">
  42. 服务信息
  43. </view>
  44. <view class="margin-right-xs">
  45. <view class="flex justify-between margin-top-lg">
  46. <view class="text-bold" style="width: 165rpx;">服务类型</view>
  47. <view class="text-white">
  48. <text v-for="(item,index) in order.orderTaking.gameId" :key="index"
  49. class="margin-left-sm">{{item}}</text>
  50. </view>
  51. </view>
  52. <view class="flex justify-between margin-top-lg">
  53. <view class="text-bold" style="width: 165rpx;">服务时间</view>
  54. <view class="text-white">{{order.startTime}}时</view>
  55. </view>
  56. <view class="flex justify-between margin-top-lg">
  57. <view class="text-bold" style="width: 165rpx;">服务地点</view>
  58. <view class="text-white" @tap="bindGps(order.latitude,order.longitude,order.detailsAddress)">
  59. {{order.city}}{{order.district}}{{order.detailsAddress}}
  60. <u-icon name="map"></u-icon>
  61. </view>
  62. </view>
  63. <view class="flex justify-between margin-top-lg">
  64. <view class="text-bold" style="width: 165rpx;">联系方式</view>
  65. <view class="text-white" @click="bindphone(order.phone)">{{order.phone}}<u-icon name="phone"></u-icon>
  66. <text class="margin-left-sm"> {{order.name}}</text></view>
  67. </view>
  68. <view class=" margin-top-lg">
  69. <view class="text-bold" style="width: 165rpx;">备注</view>
  70. <view class="text-white margin-top">{{order.remarks}}</view>
  71. </view>
  72. </view>
  73. <!-- <view class="flex justify-between margin-top">
  74. <view @click="goMsg">
  75. <u-icon name="chat" size="32" color="#557EFD" class="margin-right-sm"></u-icon>联系TA
  76. </view>
  77. <view class="text-white">实付:<text class="text-lg text-bold">{{order.payMoney}}元</text></view>
  78. </view> -->
  79. </view>
  80. <view class="bg padding radius margin-top" style="margin-bottom: 140rpx;">
  81. <view class="text-lg text-bold">
  82. 订单信息
  83. </view>
  84. <view class="margin-right-xs">
  85. <view class="flex justify-between margin-top-lg">
  86. <view class="text-bold" style="width: 165rpx;">订单编号</view>
  87. <view class="text-white">{{order.ordersNo}}</view>
  88. </view>
  89. <view class="flex justify-between margin-top-lg">
  90. <view class="text-bold" style="width: 165rpx;">下单时间</view>
  91. <view class="text-white">{{order.createTime}}</view>
  92. </view>
  93. <!-- <view class="flex justify-between margin-top-lg">
  94. <view style="width: 120upx;">支付方式</view>
  95. <view class="text-white">{{order.createTime}}</view>
  96. </view>
  97. -->
  98. </view>
  99. </view>
  100. <!-- <view class="flex tabber padding-top-sm padding-bottom-sm align-center" v-if="isTrue == 0">
  101. <u-button @click="cancelOrder(order)" shape="circle" class="margin-right-sm " :custom-style="customStyle"
  102. :hair-line="false">取消订单
  103. </u-button>
  104. <u-button @click="pay" class="margin-right-sm " shape="circle" :custom-style="customStyle2"
  105. :hair-line="false">立即支付
  106. </u-button>
  107. </view> -->
  108. <view class="flex tabber padding-top-sm padding-bottom-sm align-center margin-right-xs padding-right"
  109. v-if="order.state ==1">
  110. <u-button v-if="order.state == 1" :custom-style="customStyle" shape="circle" :plain="true"
  111. @click="cancelOrder(order,3)">拒接接单</u-button>
  112. <!-- <u-button v-if="item.state == 3" :custom-style="customStyle" shape="circle" :plain="true" @click="delOrder(item)">拒接接单</u-button> -->
  113. <u-button v-if="order.state == 1" :custom-style="customStyle1" shape="circle" :plain="true"
  114. @click="cancelOrder(order,2)">完成接单</u-button>
  115. <!-- <u-button :custom-style="customStyle" shape="circle" :plain="true" @click="clickItem(item)">联系TA
  116. </u-button> -->
  117. </view>
  118. </view>
  119. </template>
  120. <script>
  121. export default {
  122. data() {
  123. return {
  124. customStyle: {
  125. color: '#999999',
  126. border: '2rpx solid #999999',
  127. // backgroundColor: '#1E1F31',
  128. border: "8rpx",
  129. width: '180rpx',
  130. height: '54rpx',
  131. margin: "0 0 0 20rpx"
  132. },
  133. customStyle1: {
  134. color: '#557EFD',
  135. border: '2rpx solid #557EFD',
  136. // backgroundColor: '#1E1F31',
  137. border: "8rpx",
  138. width: '180rpx',
  139. height: '54rpx',
  140. margin: "0 0 0 20rpx"
  141. },
  142. id: '',
  143. order: {
  144. user: {},
  145. game: {}
  146. },
  147. isTrue: 0,
  148. vipMoney: '',
  149. data: [],
  150. price: ''
  151. }
  152. },
  153. onLoad(e) {
  154. console.log(e)
  155. var jsObject = JSON.stringify(e);
  156. console.log(jsObject)
  157. this.isTrue = e.isTrue
  158. if (this.isTrue) {
  159. uni.setNavigationBarTitle({
  160. title: '订单详情'
  161. })
  162. }
  163. this.id = e.id
  164. this.getOrder()
  165. },
  166. methods: {
  167. // 一键导航
  168. bindGps(latitude, longitude, name) {
  169. uni.openLocation({
  170. latitude: latitude - 0, //要去的纬度-地址
  171. longitude: longitude - 0, //要去的经度-地址
  172. name: name, //地址名称
  173. address: name, //详细地址名称
  174. success: function() {
  175. console.log('导航成功');
  176. },
  177. fail: function(error) {
  178. console.log(error)
  179. }
  180. });
  181. },
  182. // 拨打电话
  183. bindphone(phone) {
  184. let that = this
  185. uni.showModal({
  186. title: '提示',
  187. confirmColor:'#00B88F',
  188. content: '是否拨打电话',
  189. success: function(res) {
  190. if (res.confirm) {
  191. console.log('用户点击确定', that.phone);
  192. uni.makePhoneCall({
  193. phoneNumber: phone //仅为示例
  194. });
  195. } else if (res.cancel) {
  196. console.log('用户点击取消');
  197. }
  198. }
  199. });
  200. },
  201. binddetail(e) {
  202. console.log(e)
  203. uni.navigateTo({
  204. url: '/pages/index/game/order?id=' + e.orderTakingId
  205. })
  206. },
  207. getOrder() {
  208. let data = {
  209. id: this.id
  210. }
  211. this.$Request.get('/app/orders/queryOrders', data).then(res => {
  212. if (res.code == 0) {
  213. this.order = res.data
  214. this.order.orderTaking.gameId = this.order.orderTaking.gameId.split(",");
  215. this.price = (res.data.orderTaking.oldMoney * res.data.orderNumber)
  216. .toFixed(2)
  217. this.vipMoney = (res.data.orderTaking.money * res.data.orderNumber - res.data.payMoney * 1)
  218. .toFixed(2)
  219. console.log(this.vipMoney, 'vipvipvipv')
  220. }
  221. })
  222. },
  223. // 取消订单
  224. cancelOrder(e, status) {
  225. let that = this
  226. let content = ''
  227. if (status == 3) {
  228. content = '确定拒绝接单吗?'
  229. } else if (status == 2) {
  230. content = '确定订单已经完成吗?如果未完成,客户投诉将采取封号处理'
  231. }
  232. uni.showModal({
  233. title: '提示',
  234. content: content,
  235. confirmColor:'#00B88F',
  236. success: function(res) {
  237. if (res.confirm) {
  238. let data = {
  239. id: e.ordersId,
  240. status
  241. }
  242. that.$Request.get('/app/orders/cancelOrder', data).then(res => {
  243. if (res.code == 0) {
  244. that.getOrder()
  245. }
  246. })
  247. }
  248. },
  249. })
  250. },
  251. // 支付订单
  252. pay() {
  253. let that = this
  254. uni.showModal({
  255. title: '付款提示',
  256. content: '确认支付' + that.order.payMoney + '元吗?',
  257. success: function(re) {
  258. if (re.confirm) {
  259. console.log('用户点击确定');
  260. that.$Request.post("/app/orders/payMoney", {
  261. ordersId: that.order.ordersId,
  262. }).then(res => {
  263. if (res.code == 0) {
  264. uni.showToast({
  265. title: '支付成功'
  266. })
  267. setTimeout(function() {
  268. uni.navigateBack()
  269. }, 1000)
  270. } else {
  271. uni.showToast({
  272. title: res.msg,
  273. icon: 'none'
  274. })
  275. }
  276. });
  277. } else if (re.cancel) {
  278. console.log('用户点击取消');
  279. }
  280. }
  281. })
  282. },
  283. // cancelOrder(e) {
  284. // let data = {
  285. // id: e.ordersId,
  286. // status: '3'
  287. // }
  288. // this.$Request.get('/app/orders/cancelOrder', data).then(res => {
  289. // if (res.code == 0) {
  290. // uni.showToast({
  291. // title: '取消成功',
  292. // icon: 'none'
  293. // })
  294. // setTimeout(function() {
  295. // uni.navigateBack()
  296. // }, 1000)
  297. // }
  298. // })
  299. // },
  300. goMsg() {
  301. let data = {
  302. userId: uni.getStorageSync('userId'),
  303. focusedUserId: this.order.user.userId
  304. }
  305. this.$Request.postJson('/app/chat/insertChatConversation ', data).then(res => {
  306. if (res.code == 0) {
  307. let id = this.order.user.userId == res.data.userId ? res.data.focusedUserId : this.order
  308. .user.userId
  309. uni.navigateTo({
  310. url: '/pages/msg/im?chatConversationId=' + res.data.chatConversationId +
  311. '&byUserId=' + id
  312. })
  313. }
  314. })
  315. },
  316. }
  317. }
  318. </script>
  319. <style>
  320. page {
  321. background: #f7f7f7;
  322. }
  323. .bg {
  324. background: #FFFFFF;
  325. }
  326. .tabber {
  327. width: 100%;
  328. background: #ffffff;
  329. position: fixed;
  330. bottom: 0;
  331. left: 0;
  332. right: 0;
  333. justify-content: flex-end;
  334. height: 127rpx;
  335. }
  336. </style>