alipay.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <div class="app-content pay-wrap">
  3. <div class="delivery-wrap">
  4. <div class="btn-wrap">
  5. <!-- #ifdef H5 -->
  6. <button class="button-com red" @click="go()" v-if="hasRenew == 1">正在打开支付宝...</button>
  7. <view style="margin-top:50upx;font-size:40upx;font-weight:bold;text-align: center;" v-if="hasRenew == 0">商家还未开通此功能</view>
  8. <!-- #endif -->
  9. </div>
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. import { purchaseClearAliPay } from '@/api/purchase'
  15. export default {
  16. name: 'alipay',
  17. components: {
  18. },
  19. mixins: [],
  20. data() {
  21. return {
  22. payUrl:'',
  23. hasRenew:1
  24. }
  25. },
  26. computed: {
  27. },
  28. onLoad(options) {
  29. let orderSn = options.orderSn ? options.orderSn:''
  30. this.payInit(orderSn)
  31. },
  32. mounted() {},
  33. methods: {
  34. init(){
  35. },
  36. go(){
  37. if(this.hasRenew == 1){
  38. window.location.href = this.payUrl
  39. }
  40. },
  41. payInit(orderSn) {
  42. if (orderSn==''){
  43. uni.showToast({title: '没有找到订单号',icon: 'none',duration: 1500})
  44. return false
  45. }
  46. purchaseClearAliPay({orderSn:orderSn}).then(res=>{
  47. if(res.code == 0){
  48. uni.showToast({title: res.msg,icon: 'none',duration: 1500})
  49. return false
  50. }
  51. this.hasRenew = res.data.hasRenew?res.data.hasRenew:0
  52. if(res.data.hasRenew && res.data.hasRenew == 1){
  53. this.payUrl = res.data.payUrl
  54. window.location.href = this.payUrl
  55. }
  56. })
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="scss">
  62. .app-content {
  63. min-height: calc(100vh - 20upx);
  64. padding-top: 20upx;
  65. }
  66. .tabs-wrap {
  67. position: fixed;
  68. top: 0;
  69. width: 100%;
  70. height: 80upx;
  71. line-height: 80upx;
  72. text-align: center;
  73. background-color: #fff;
  74. font-size: 30upx;
  75. box-shadow: 4upx 4upx 10upx #eee;
  76. }
  77. .pay-wrap {
  78. .pay-input-wrap {
  79. background-color: #fff;
  80. border-top-left-radius: 20upx;
  81. border-top-right-radius: 20upx;
  82. padding: 50upx 80upx 28upx;
  83. margin-bottom: 0 !important;
  84. .balance {
  85. margin-top: 30upx;
  86. color: #666666;
  87. }
  88. .btn-wrap {
  89. width: 100%;
  90. margin-top: 64upx;
  91. .button-com {
  92. display: block;
  93. margin-bottom: 20upx;
  94. padding-top: 30upx;
  95. padding-bottom: 30upx;
  96. }
  97. }
  98. }
  99. }
  100. // 我要配送
  101. .delivery-wrap {
  102. .module-com {
  103. margin-bottom: 20upx;
  104. background-color: #fff;
  105. .module-tit {
  106. padding: 20upx 18upx;
  107. font-size: 28upx;
  108. font-weight: 600;
  109. border-bottom: 1upx solid #eee;
  110. }
  111. .module-det {
  112. padding: 0 30upx;
  113. }
  114. }
  115. // 金额
  116. .pay-input-wrap {
  117. padding: 50upx 36upx 38upx;
  118. .balance {
  119. margin-top: 30upx;
  120. color: #666666;
  121. }
  122. }
  123. .shop-logo-wrap {
  124. padding-bottom: 20upx;
  125. .logo-img {
  126. width: 100%;
  127. margin: 10upx auto;
  128. align-items: center;
  129. .logo {
  130. width: 100upx;
  131. height:100upx;
  132. border-radius: 10upx;
  133. margin-left:10upx;
  134. float: left;
  135. }
  136. .title{
  137. margin-left:20upx;
  138. float:left;
  139. width:600upx;
  140. height:100upx;
  141. line-height:100upx;
  142. font-size:38upx;
  143. font-weight: bold;
  144. }
  145. }
  146. }
  147. // 可选优惠
  148. .discount-wrap {
  149. .module-det {
  150. padding-top: 20upx;
  151. padding-bottom: 20upx;
  152. }
  153. }
  154. // 匿名派送
  155. .none-name-delivery {
  156. // padding-left: 30upx;
  157. padding: 26upx 30upx;
  158. // margin-top: 40upx;
  159. margin-bottom: 20upx;
  160. background-color: #fff;
  161. .none-name-text {
  162. margin-left: 14upx;
  163. color: #666666;
  164. }
  165. }
  166. // 按钮
  167. .btn-wrap {
  168. width: calc(100% - 60upx);
  169. margin: 64upx auto 0;
  170. padding-bottom: 20upx;
  171. .button-com {
  172. display: block;
  173. margin-bottom: 20upx;
  174. padding-top: 30upx;
  175. padding-bottom: 30upx;
  176. &:last-child {
  177. margin-bottom: 0;
  178. }
  179. }
  180. }
  181. // 查看更多
  182. .view-more {
  183. width: auto;
  184. padding-bottom: 20upx;
  185. margin-bottom: 20upx;
  186. font-size: 28upx;
  187. background-color: #fff;
  188. color: #666565;
  189. justify-content: flex-start;
  190. z-index:9999999;
  191. .view-more-text {
  192. margin-right: 14upx;
  193. }
  194. padding-left:40upx;
  195. i {
  196. font-size: 30upx;
  197. font-weight: 600;
  198. }
  199. .fill-get-man{
  200. color:red;
  201. margin-left:10upx;
  202. font-weight:600;
  203. text-decoration:underline;
  204. }
  205. .pack-up{
  206. margin-left:20upx;
  207. font-weight:600;
  208. color:red;
  209. text-decoration:underline;
  210. }
  211. &.open {
  212. i {
  213. transform: rotate(180deg);
  214. }
  215. }
  216. }
  217. }
  218. </style>