group-info.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. <template>
  2. <view class="flex-common-css">
  3. <Nav title=" " leftIconColor="#333" titleColor="#333" bgckgroundBox='transparent'></Nav>
  4. <image class="bg-img" src="@/static/img/order/bg.png" mode=""></image>
  5. <view class="p-24-24-0 box-border-box">
  6. <view class="mb-24" v-show="infoData.order_status == 1">
  7. <view class="fs-40 fc-3 mb-8">
  8. {{infoData.order_status_str}},剩余{{time.m}}:{{time.s}}
  9. </view>
  10. <view class="fs-24 fc-FB3D03">
  11. 10分钟内未支付,订单将自动取消
  12. </view>
  13. </view>
  14. <view class="mb-24">
  15. <view class="fs-48 fc-3 fw-600">
  16. {{infoData.order_status_str}}
  17. </view>
  18. </view>
  19. <view class="bgc-f b-rad-20 p-24 box-border-box">
  20. <view class="p-b-20 mb-24 b-b-F9F9F9 fs-32 fc-3" v-show="infoData.order_status == 1">
  21. 请尽快支付
  22. </view>
  23. <view class="p-b-20 mb-24 b-b-F9F9F9 fs-32 fc-3" v-show="infoData.order_status == 4">
  24. 感谢你对君子校园的信任,期待你再次光临
  25. </view>
  26. <view class="align-items-center flex-wrap-wrap">
  27. <view @click="pay" class="w-33 flex-direction align-items-center" v-show="infoData.order_status == 1">
  28. <image class="mb-4 icon" src="@/static/img/order/qzf.png" mode=""></image>
  29. <view class="fs-24 fc-41ABF5">
  30. 去支付
  31. </view>
  32. </view>
  33. <view class="w-33 flex-direction align-items-center" v-show="infoData.order_status == 1 || infoData.order_status == 2">
  34. <image class="mb-4 icon" src="@/static/img/order/xgdd.png" mode=""></image>
  35. <view class="fs-24 fc-3">
  36. 修改订单信息
  37. </view>
  38. </view>
  39. <view class="w-33 flex-direction align-items-center" v-show="infoData.order_status == 4 || infoData.order_status == 6">
  40. <image class="mb-4 icon" src="@/static/img/order/zlyd.png" mode=""></image>
  41. <view class="fs-24 fc-41ABF5">
  42. 再来一单
  43. </view>
  44. </view>
  45. <view class="w-33 flex-direction align-items-center">
  46. <image class="mb-4 icon" src="@/static/img/order/lxkf.png" mode=""></image>
  47. <view class="fs-24 fc-3">
  48. 联系客服
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <scroll-view :scroll-y="true" class="scroll-view-css p-24 box-border-box" @scrolltolower="scrolltolower">
  55. <view class="bgc-f b-rad-20 p-24 box-border-box mb-20">
  56. <!-- <view class="w-420 fc-3 fs-32 fw-600 text-overflow-ellipsis-one mb-24">
  57. {{infoData.site_name}}
  58. </view> -->
  59. <view class="goods-box">
  60. <view class="align-items-center flex-justify-space mb-20">
  61. <image class="goods-img mr-16 flex-shrink0" :src="infoData.goods_img" mode=""></image>
  62. <view class="">
  63. <view class="align-items-center flex-justify-space mb-2">
  64. <view class="fs-28 fc-3 w-300 text-overflow-ellipsis-one mr-36">
  65. {{infoData.goods_name}}
  66. </view>
  67. <view class="fs-32 fc-3 fw-600">
  68. ¥{{infoData.goods_price}}
  69. </view>
  70. </view>
  71. <!-- <view class="mb-2 fs-24 fc-9">
  72. {{item.goods_name}}
  73. </view> -->
  74. <view class="fs-24 fc-9">
  75. x{{infoData.goods_number}}
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. <!-- <view class="align-items-center flex-justify-space mb-24">
  81. <view class="fs-28 fc-3">
  82. 打包费
  83. </view>
  84. <view class="fs-32 fc-3">
  85. 打包费
  86. </view>
  87. </view>
  88. <view class="align-items-center flex-justify-space mb-24">
  89. <view class="fs-28 fc-3">
  90. 配送费
  91. </view>
  92. <view class="fs-32 fc-3">
  93. 打包费
  94. </view>
  95. </view> -->
  96. <!-- <view class="align-items-center flex-justify-space pb-36 b-b-F9F9F9 mb-22">
  97. <view class="align-items-center">
  98. <image class="mr-6 icon-right" src="@/static/img/order/yhq.png" mode=""></image>
  99. <view class="fs-28 fc-3">
  100. 优惠券
  101. </view>
  102. </view>
  103. <view class="fs-32 fc-FB3D03">
  104. -¥{{infoData.coupon_money}}
  105. </view>
  106. </view> -->
  107. <view class="align-items-center flex-justify-end">
  108. <view class="fs-28 fc-9">
  109. 共{{infoData.goods_number}}件,
  110. </view>
  111. <view class="fs-28 fc-3">
  112. 定金
  113. </view>
  114. <view class="fs-24 fw-600 fc-3">
  115. ¥
  116. </view>
  117. <view class="fs-36 fw-600 fc-3">
  118. {{infoData.pay_money}}
  119. </view>
  120. </view>
  121. </view>
  122. <view class="bgc-f b-rad-20 p-24 box-border-box mb-20">
  123. <view class="display-flex flex-justify-space mb-26">
  124. <view class="fs-28 fc-9">
  125. 配送地址
  126. </view>
  127. <view class="fs-28 fc-3 w-480 text-align-right">
  128. {{infoData.address}}
  129. </view>
  130. </view>
  131. <!-- <view class="display-flex flex-justify-space mb-26">
  132. <view class="fs-28 fc-9">
  133. 配送时间
  134. </view>
  135. <view class="fs-28 fc-3 w-480 text-align-right">
  136. 预约配送
  137. </view>
  138. </view> -->
  139. <!-- <view class="display-flex flex-justify-space pb-20 b-b-F9F9F9 mb-26" v-show="infoData.order_status == 3">
  140. <view class="fs-28 fc-9">
  141. 骑手信息
  142. </view>
  143. <view class="fs-28 fc-3 w-480 text-align-right">
  144. {{infoData.rider.rider_name}}{{infoData.rider.phone}}
  145. </view>
  146. </view> -->
  147. <view class="display-flex flex-justify-space mb-26">
  148. <view class="fs-28 fc-9">
  149. 订单编号
  150. </view>
  151. <view class="align-items-center flex-justify-end">
  152. <view class="fs-28 fc-3 w-480 mr-8 text-align-right">
  153. {{infoData.order_sn}}
  154. </view>
  155. <image class="icon-fz" src="@/static/img/order/fz.png" mode=""></image>
  156. </view>
  157. </view>
  158. <view class="display-flex flex-justify-space mb-26">
  159. <view class="fs-28 fc-9">
  160. 下单时间
  161. </view>
  162. <view class="fs-28 fc-3 w-480 text-align-right">
  163. {{infoData.created_at}}
  164. </view>
  165. </view>
  166. <view class="display-flex flex-justify-space mb-26">
  167. <view class="fs-28 fc-9">
  168. 支付方式
  169. </view>
  170. <view class="fs-28 fc-3 w-480 text-align-right">
  171. {{infoData.pay_type_str}}
  172. </view>
  173. </view>
  174. <view class="display-flex flex-justify-space">
  175. <view class="fs-28 fc-9">
  176. 备注
  177. </view>
  178. <view class="fs-28 fc-3 w-480 text-align-right">
  179. {{infoData.note?infoData.note:'无'}}
  180. </view>
  181. </view>
  182. </view>
  183. </scroll-view>
  184. </view>
  185. </template>
  186. <script>
  187. import {
  188. groupOrderInfo
  189. } from "@/api/groupOrder.js"
  190. import {
  191. groupPay
  192. } from '@/api/groupOrder.js';
  193. import tools from "@/service/tools";
  194. export default {
  195. components: {},
  196. data() {
  197. return {
  198. goodsData: [{
  199. name: '1'
  200. }, {
  201. name: '2'
  202. }],
  203. infoData: {},
  204. time: {
  205. day: '',
  206. h: "",
  207. m: '',
  208. s: '',
  209. },
  210. isAJAX: false
  211. };
  212. },
  213. onLoad(data) {
  214. if (data) {
  215. this.groupOrderInfo(data.orderId)
  216. }
  217. },
  218. mounted() {},
  219. methods: {
  220. pay() {
  221. this.groupPay(this.infoData.id)
  222. },
  223. groupPay(id) {
  224. // 代取支付
  225. groupPay({
  226. order_id: id
  227. }).then((ret) => {
  228. if (ret.code === 1) {
  229. uni.requestPayment({
  230. provider: "wxpay", //支付类型-固定值
  231. timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
  232. nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
  233. package: ret.data.wx_pay.package, // 固定值
  234. signType: ret.data.wx_pay.signType, //固定值
  235. paySign: ret.data.wx_pay.paySign, //签名
  236. success: (ren) => {
  237. tools.success("支付成功");
  238. this.isAJAX = false;
  239. this.groupOrderInfo(this.infoData.id)
  240. },
  241. fail: (err) => {
  242. this.isAJAX = false;
  243. tools.error("支付失败");
  244. },
  245. });
  246. } else {
  247. this.isAJAX = false;
  248. tools.error("支付失败");
  249. }
  250. })
  251. },
  252. scrolltolower() {
  253. // console.log('触底');
  254. },
  255. groupOrderInfo(id) {
  256. groupOrderInfo({
  257. order_id: id
  258. }).then((res) => {
  259. if (res.code == 1) {
  260. this.infoData = res.data
  261. if (this.infoData.order_status == 1) {
  262. let createDate = new Date(res.data.created_at); //格式化订单创建时候的时间
  263. createDate.setMinutes(createDate.getMinutes() + 10)
  264. this.setCountDown(createDate)
  265. }
  266. }
  267. })
  268. },
  269. setCountDown(sTime) {
  270. let end = new Date(sTime).getTime();
  271. let now = new Date().getTime();
  272. let msec = end - now;
  273. this.time.day = parseInt(msec / 1000 / 60 / 60 / 24);
  274. let h = parseInt(msec / 1000 / 60 / 60 % 24);
  275. let m = parseInt(msec / 1000 / 60 % 60);
  276. let s = parseInt(msec / 1000 % 60);
  277. this.time.h = h > 9 ? h : '0' + h;
  278. this.time.m = m > 9 ? m : '0' + m;
  279. this.time.s = s > 9 ? s : '0' + s;
  280. msec -= 1000;
  281. if (this.time.day >= 1) {
  282. this.showTime = true;
  283. } else {
  284. this.showTime = false;
  285. };
  286. if (msec >= 0) {
  287. setTimeout(() => {
  288. this.setCountDown(sTime);
  289. }, 1000);
  290. } else {
  291. this.isTimeEnd = true;
  292. this.bText = '活动结束';
  293. this.time.h = '--';
  294. this.time.m = '--';
  295. this.time.s = '--';
  296. };
  297. }
  298. },
  299. }
  300. </script>
  301. <style lang="scss" scoped>
  302. .bg-img {
  303. position: fixed;
  304. left: 0;
  305. top: 0;
  306. z-index: -1;
  307. width: 100%;
  308. height: 320rpx;
  309. }
  310. .w-33 {
  311. width: 33%;
  312. }
  313. .p-24-24-0 {
  314. padding: 24rpx 24rpx 0;
  315. }
  316. .icon {
  317. width: 48rpx;
  318. height: 48rpx;
  319. }
  320. .w-420 {
  321. width: 420rpx;
  322. }
  323. .goods-img {
  324. width: 108rpx;
  325. height: 108rpx;
  326. border-radius: 8rpx;
  327. }
  328. .w-300 {
  329. width: 300rpx;
  330. }
  331. .icon-right {
  332. width: 32rpx;
  333. height: 32rpx;
  334. }
  335. .w-480 {
  336. width: 480rpx;
  337. }
  338. .icon-fz {
  339. width: 24rpx;
  340. height: 24rpx;
  341. }
  342. .goods-box {
  343. overflow: hidden;
  344. }
  345. .goodsShowOne {
  346. max-height: 508rpx;
  347. transition: all .5s linear;
  348. }
  349. .goodsShowTwo {
  350. height: auto;
  351. transition: all .5s linear;
  352. }
  353. </style>