submitOrder.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <view class="">
  3. <view class="top">
  4. <view class="image">
  5. <image src="https://t38.9026.com/uploads/golf/images/2022-05-31/20220531601652.png" ></image>
  6. </view>
  7. <view class="">
  8. <view class="" style="font-size: 32rpx;font-weight: 600;">
  9. {{suborder.name}}
  10. </view>
  11. <view class="" style="font-size: 28rpx;margin-top: 20rpx;">
  12. 日期:{{suborder.day}}
  13. </view>
  14. </view>
  15. </view>
  16. <view class="" style="padding: 0 30rpx;color: #666666;">
  17. <!-- 夕阳红康养团是为中老年特别定制的康养方案这个团 非常好 -->
  18. {{suborder.subtitle}}
  19. </view>
  20. <view class="suborder">
  21. <view class="name">
  22. 出行人姓名:<text v-for="(item,index) in peoplelist" :key="index" style="margin: 0 10rpx;">{{item}}</text>
  23. </view>
  24. <view class="contract">
  25. <u-cell-group>
  26. <u-cell title="合同预览" isLink url="./contract" :titleStyle="{'font-weight': 'bold'}" size="large"></u-cell>
  27. </u-cell-group>
  28. </view>
  29. <view class="checkbox">
  30. <u-checkbox-group v-model="agree" size="32" iconPlacement="right" placement="row">
  31. <u-checkbox activeColor="#31866F" inactiveColor="#0A243F"></u-checkbox>
  32. </u-checkbox-group>
  33. <view class="text">
  34. 我已阅读并同意报名须知 <text style="text-decoration: underline;padding: 6rpx;" @click="notification">安全告知 </text> 和
  35. <text style="text-decoration: underline;padding: 6rpx;" @click="Policy">隐私政策</text>
  36. </view>
  37. </view>
  38. <view class="time">
  39. <view>订单支付倒计时:</view><u-count-down :time="30 * 60 * 60 * 1000" format="HH:mm:ss"></u-count-down>
  40. </view>
  41. </view>
  42. <view class="navbar">
  43. <view class="navbar-item">
  44. 总金额 ¥12929
  45. </view>
  46. <view class="navbar-item want" @click="Submit" >
  47. 去支付
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. export default{
  54. data(){
  55. return{
  56. suborder:{},
  57. peoplelist:[]
  58. }
  59. },
  60. onLoad(options) {
  61. // JSON.parse(val.content);
  62. // console.log(options.suborder)
  63. let suborder=JSON.parse(options.suborder)
  64. // this.init(suborder)
  65. this.suborder=suborder
  66. console.log(suborder)
  67. this.suborder.people.forEach((item,index)=>{
  68. this.peoplelist.push(item)
  69. })
  70. },
  71. // onShow() {
  72. // const pages= getCurrentPages();//获取应用页面栈
  73. // let aaa= pages[pages.length - 1].options//获取页面传递的信息
  74. // console.log(aaa)
  75. // },
  76. methods:{
  77. // init(val){
  78. // this.suborder=val
  79. // let list=[]
  80. // this.suborder.forEach((item,index)=>{
  81. // list.push(item.name)
  82. // })
  83. // this.peoplelist=list
  84. // },
  85. gocontract(){
  86. uni.navigateTo({
  87. url:"./contract"
  88. })
  89. },
  90. // 支付
  91. Submit(){
  92. uni.$u.http.post('/api/order/config',{
  93. order_id:this.suborder.order_id,
  94. }).then(res=>{
  95. console.log(res)
  96. uni.requestPayment({
  97. provider: 'wxpay', //支付类型-固定值
  98. timeStamp: res.timeStamp, // 时间戳(单位:秒)
  99. nonceStr: res.nonceStr, // 随机字符串
  100. package: res.package, // 固定值
  101. signType: res.signType, //固定值
  102. paySign: res.paySign, //签名
  103. success: function (res) {
  104. // console.log('success:' + JSON.stringify(res));
  105. console.log("支付成功");
  106. },
  107. fail: function (err) {
  108. console.log('fail:' + JSON.stringify(err));
  109. console.log("支付失败");
  110. }
  111. });
  112. }).catch(err=>{
  113. console.log(err)
  114. uni.showToast({
  115. icon:"error",
  116. title:err.message,
  117. })
  118. })
  119. },
  120. notification(){
  121. uni.navigateTo({
  122. url:"/pages/userCenter/notification"
  123. })
  124. },
  125. Policy(){
  126. uni.navigateTo({
  127. url:"/pages/userCenter/Policy"
  128. })
  129. }
  130. }
  131. }
  132. </script>
  133. <style lang="less">
  134. .u-cell__body--large.data-v-913eaa32{
  135. padding: 48rpx 0 !important;
  136. box-sizing: border-box;
  137. }
  138. page{
  139. background-color: #F4F4F4;
  140. font-size: 30rpx;
  141. }
  142. .checkbox{
  143. display: flex;
  144. padding: 30rpx;
  145. .text{
  146. margin-left: 10rpx;
  147. font-size: 26rpx;
  148. }
  149. }
  150. .top{
  151. margin-top: 32rpx;
  152. padding:10rpx 30rpx;
  153. display: flex;
  154. align-items: center;
  155. align-items: center;
  156. margin-bottom: 20rpx;
  157. .image{
  158. margin-right: 20rpx;
  159. image{
  160. width: 180rpx;
  161. height: 110rpx;
  162. }
  163. }
  164. }
  165. .suborder{
  166. position: relative;
  167. margin-top: 30rpx;
  168. padding: 48rpx 30rpx;
  169. background-color: #fff;
  170. border-radius: 0px 56rpx 0px 0px;
  171. height:calc(100vh - 323rpx);
  172. box-sizing: border-box;
  173. .name{
  174. // padding: 30rpx;
  175. margin-bottom: 48rpx;
  176. }
  177. .contract{
  178. margin-top: 50rpx;
  179. }
  180. .time{
  181. position: absolute;
  182. left: 0;bottom: 75rpx;
  183. width: 100%;
  184. background-color: #F4F4F4;
  185. border-radius: 16rpx 16rpx 0px 0px;
  186. display: flex;
  187. padding: 24rpx 0rpx 24rpx 30rpx;
  188. }
  189. }
  190. .navbar{
  191. margin-top:104rpx;
  192. display: flex;
  193. justify-content: space-between;
  194. align-items: center;
  195. bottom: 0;
  196. left: 0;
  197. position: fixed;
  198. width: 100%;
  199. height: 104rpx;
  200. background: #1E9F6A;
  201. border-radius: 16rpx 16rpx 0px 0px;
  202. color: #ffffff;
  203. .navbar-item{
  204. width: 50%;
  205. text-align: center;
  206. }
  207. .want{
  208. border-left: 1rpx solid #FFFFFF;
  209. }
  210. }
  211. </style>