group-info.vue 9.6 KB

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