猫妈狗爸伴宠师小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

424 lines
8.7 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <!-- <div>订单详情</div> -->
  3. <view class="box box-size">
  4. <view class="top box-size" :style="{ borderRadius: '16rpx' }">
  5. <view class="top_left box-size">
  6. <view>
  7. 本单客户支付金额
  8. <view class="vertically_center text1">
  9. ¥ 45
  10. </view>
  11. </view>
  12. X
  13. <view>
  14. 您的分成比例
  15. <view class="vertically_center text1">
  16. 20%
  17. </view>
  18. </view>
  19. =
  20. <view>
  21. 本单酬劳
  22. <view class="vertically_center text1">
  23. ¥ 9
  24. </view>
  25. </view>
  26. </view>
  27. <view class="top_bottom">
  28. 订单为系统派发请确认订单信息后再抢单
  29. </view>
  30. <view class="top-button" :style="{ borderRadius: '27rpx' }">
  31. 系统派单
  32. </view>
  33. </view>
  34. <view class="information box-size" :style="{ borderRadius: '16rpx' }">
  35. <view class="form-title">
  36. 基本信息
  37. </view>
  38. <view class="line1">
  39. </view>
  40. <view class="time">
  41. <view>
  42. 服务日期
  43. </view>
  44. <view class="">
  45. 12-012-08
  46. </view>
  47. </view>
  48. <view class="line1">
  49. </view>
  50. <view class="time">
  51. <view>
  52. 服务地址
  53. </view>
  54. <view class="">
  55. {{ orderDetail.address }}
  56. </view>
  57. </view>
  58. </view>
  59. <view class="service box-size" :style="{ borderRadius: '8rpx' }">
  60. <view class="horizontal_distribution service_top">
  61. <view class="form-title">
  62. 服务内容和酬劳
  63. </view>
  64. <view @click="petInfo" class="text2 flex">
  65. 查看宠物信息
  66. <u-icon name="arrow-right-double" color="#F5F5F5" size="10"></u-icon>
  67. </view>
  68. </view>
  69. <view class="line1">
  70. </view>
  71. <view v-for="pet in orderDetail.appletPetList" :key="pet.id" class="pet_information box-size">
  72. <view class="flex pet_item box-size">
  73. <view class="img" :style="{borderRadius:'100rpx'}">
  74. <image :src="pet.headImage" mode=""></image>
  75. </view>
  76. <view class="">
  77. <view class="flex name">
  78. <view class="name_text">
  79. {{ pet.nickName }}
  80. </view>
  81. <image src="" mode=""></image>
  82. </view>
  83. {{ pet.type }}
  84. </view>
  85. </view>
  86. <view class="pet- level">
  87. 12-14
  88. <text>专业喂养</text>
  89. 上门1次
  90. </view>
  91. <view class="pet- level">
  92. 12-15
  93. <text>专业喂养</text>
  94. 上门1次
  95. </view>
  96. </view>
  97. <view class="line1">
  98. </view>
  99. <view class="flex money_total">
  100. <view>
  101. 合计
  102. </view>
  103. <view class="money_text">
  104. ¥&nbsp;{{ orderDetail.price }}
  105. </view>
  106. </view>
  107. </view>
  108. <view class="other_information box-size">
  109. <view class="form-title">
  110. 其他信息
  111. </view>
  112. <view class="line1">
  113. </view>
  114. <view class="horizontal_distribution text3">
  115. <view>
  116. 订单编号
  117. </view>
  118. <view>
  119. fe34521532513256
  120. </view>
  121. </view>
  122. <view class="line1">
  123. </view>
  124. <view class="horizontal_distribution text3">
  125. <view>
  126. 下单时间
  127. </view>
  128. <view>
  129. {{ orderDetail.createTime }}
  130. </view>
  131. </view>
  132. <view class="line1">
  133. </view>
  134. <view class="horizontal_distribution text3">
  135. <view>
  136. 支付时间
  137. </view>
  138. <view>
  139. {{ orderDetail.payTime }}
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. <view class="bottom">
  145. <view @click="rushToBuyAnOrder" class="bottom_button level" :style="{ borderRadius: '41rpx' }">
  146. 立即抢单
  147. </view>
  148. </view>
  149. <up-popup :show="showConfirmOrder" mode="bottom" @close="close" @open="open" :round="10" :closeable="true"
  150. :safeAreaInsetBottom="false"
  151. :customStyle="{padding:'60rpx 20rpx 40rpx 20rpx;position:relative;height:auto;background:#F6F5F8;'}">
  152. <view>
  153. <view style="position:absolute;top: 20rpx;left:0;text-align: center;width: 100%;">
  154. 订单信息
  155. </view>
  156. <view style="text-align: center;">
  157. 请全部确认后接单
  158. </view>
  159. <view class="order-confirmation">
  160. <view class="confirmation-item">
  161. <view class="confirmation-base">
  162. <view class="title">
  163. 服务日期
  164. </view>
  165. <view class="desc">
  166. 共两天:12-09,01-09
  167. </view>
  168. </view>
  169. <view class="ok">
  170. <view class="btn">
  171. 点击确定
  172. </view>
  173. </view>
  174. </view>
  175. <view class="confirmation-item">
  176. <view class="confirmation-base">
  177. <view class="title">
  178. 服务地址
  179. </view>
  180. <view class="desc">
  181. xxx省xx市
  182. </view>
  183. </view>
  184. <view class="ok">
  185. <view class="btn">
  186. 点击确定
  187. </view>
  188. </view>
  189. </view>
  190. <view class="confirmation-item">
  191. <view class="confirmation-base">
  192. <view class="title">
  193. 服务宠物
  194. </view>
  195. <view class="desc">
  196. <view class="">
  197. 中华田园犬
  198. </view>
  199. <view class="">
  200. 中华田园犬2
  201. </view>
  202. </view>
  203. </view>
  204. <view class="ok">
  205. <view class="btn">
  206. 点击确定
  207. </view>
  208. </view>
  209. </view>
  210. </view>
  211. <view class="handbook">
  212. 接单即接受
  213. <text class="text">伴宠师手册</text>
  214. </view>
  215. <up-button @click="conform" color="#FFBF60" text="确定" shape="circle"></up-button>
  216. </view>
  217. </up-popup>
  218. <!-- 抢单成功 -->
  219. <up-popup :show="showOrderSuccess" mode="center" @close="orderSuccessClose" @open="orderSuccessOpen" :zIndex="999"
  220. :round="10" :safeAreaInsetBottom="false" :customStyle="{padding:'40rpx 20rpx',width:'80%'}">
  221. <view>
  222. <view class="success-desc">
  223. 请立即添加服务顾问并提供订单编码
  224. </view>
  225. <view class="qr-code">
  226. <image class="code-img" src="https://img.xjishu.com/img/zl/2018/6/30/1241359458913.gif"
  227. mode="aspectFill"></image>
  228. </view>
  229. <view class="input">
  230. <up-input placeholder="" border="none" v-model="value" disabled
  231. :customStyle="{height:'60rpx','text-indent': '20rem'}"></up-input>
  232. </view>
  233. <up-button @click="noneOrder" color="#FFBF60" text="复制订单编号" shape="circle"></up-button>
  234. </view>
  235. </up-popup>
  236. </template>
  237. <script setup>
  238. import {
  239. ref,
  240. computed
  241. } from 'vue'
  242. import {
  243. onLoad
  244. } from '@dcloudio/uni-app'
  245. import {
  246. getByOrderId
  247. } from "@/api/receivingHall/index.js"
  248. import {
  249. onShow
  250. } from '@dcloudio/uni-app'
  251. import order from '../../../api/order/order'
  252. import {
  253. startByOrderId
  254. } from "@/api/receivingHall/index.js"
  255. import {
  256. useStore
  257. } from "vuex"
  258. onLoad((options) => {
  259. orderId.value = options.id || null;
  260. });
  261. onShow(() => {
  262. getDetail();
  263. })
  264. const store = useStore();
  265. const orderId = ref(null);
  266. const orderDetail = ref({});
  267. const showConfirmOrder = ref(false);
  268. const showOrderSuccess = ref(false);
  269. const value = ref("45619491656")
  270. const userInfo = computed(() => {
  271. return store.getters.userInfo
  272. })
  273. // 抢单
  274. const rushToBuyAnOrder = () => {
  275. open()
  276. }
  277. // 查看宠物信息
  278. const petInfo = () => {
  279. uni.navigateTo({
  280. url: "/otherPages/orderTakingManage/pet/index"
  281. })
  282. }
  283. const open = () => {
  284. showConfirmOrder.value = true;
  285. }
  286. const close = () => {
  287. showConfirmOrder.value = false;
  288. }
  289. const orderSuccessClose = () => {
  290. showOrderSuccess.value = false;
  291. };
  292. const orderSuccessOpen = () => {
  293. showOrderSuccess.value = true;
  294. };
  295. const conform = async () => {
  296. close();
  297. let response = await startByOrderId({
  298. id: orderId.value,
  299. userId: userInfo.value.userId
  300. })
  301. if (response.code == 200 && response.data) {
  302. uni.showToast({
  303. title: '接单成功~',
  304. icon: "none"
  305. });
  306. orderSuccessOpen();
  307. }
  308. }
  309. const getDetail = async () => {
  310. let response = await getByOrderId({
  311. id: orderId.value
  312. });
  313. if (response.code == 200 && response.data) {
  314. orderDetail.value = response.data;
  315. }
  316. }
  317. </script>
  318. <style scoped lang="scss">
  319. @import "index";
  320. .line1 {
  321. position: relative;
  322. margin: 10rpx 0 20rpx 0;
  323. &::before {
  324. position: absolute;
  325. top: 10rpx;
  326. left: -10rpx;
  327. content: "";
  328. width: 690rpx;
  329. height: 0.5rpx;
  330. background-color: #EFEFEF;
  331. // background-color: red;
  332. }
  333. }
  334. .order-confirmation {
  335. .confirmation-item {
  336. display: flex;
  337. justify-content: space-between;
  338. align-items: center;
  339. background: white;
  340. padding: 20rpx;
  341. border-radius: 20rpx;
  342. overflow: hidden;
  343. margin: 20rpx 0rpx;
  344. .confirmation-base {
  345. width: 75%;
  346. .title {
  347. font-size: 34rpx;
  348. }
  349. .desc {
  350. color: #999999;
  351. }
  352. }
  353. .ok {
  354. display: flex;
  355. justify-content: center;
  356. width: 25%;
  357. .btn {
  358. display: flex;
  359. align-items: center;
  360. justify-content: center;
  361. background: #FFBF60;
  362. color: white;
  363. width: 100%;
  364. height: 60rpx;
  365. border-radius: 30rpx;
  366. }
  367. }
  368. }
  369. }
  370. .handbook {
  371. color: #999999;
  372. margin: 10rpx 0rpx;
  373. .text {
  374. color: #FFBF60;
  375. }
  376. }
  377. .success-desc {
  378. text-align: center;
  379. color: #787878;
  380. font-size: 32rpx;
  381. }
  382. .qr-code {
  383. display: flex;
  384. justify-content: center;
  385. margin: 40rpx 0rpx;
  386. .code-img {
  387. width: 160rpx;
  388. height: 160rpx;
  389. }
  390. }
  391. .input {
  392. margin-bottom: 40rpx;
  393. }
  394. </style>