普兆健康管家前端代码仓库
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.

260 lines
5.8 KiB

  1. <template>
  2. <view>
  3. <uv-popup ref="popup" mode="bottom" bgColor="none" >
  4. <view class="popup__view">
  5. <view class="flex header">
  6. <view class="title">支付订单</view>
  7. <button class="btn" @click="close">关闭</button>
  8. </view>
  9. <view class="main">
  10. <view class="section flex flex-column info">
  11. <view class="info-title">{{ orderData.title }}</view>
  12. <view class="flex info-amount">¥<text class="highlight">{{ orderData.amount }}</text></view>
  13. </view>
  14. <view class="section flex payment">
  15. <view class="flex">
  16. <image class="payment-icon" src="@/pages_order/static/order/icon-wx.png" mode="widthFix"></image>
  17. <view class="payment-text">微信</view>
  18. </view>
  19. <view>
  20. <uv-radio-group
  21. :value="1"
  22. shape="circle"
  23. size="36rpx"
  24. iconSize="36rpx"
  25. activeColor="#7451DE"
  26. >
  27. <uv-radio :name="1"></uv-radio>
  28. </uv-radio-group>
  29. </view>
  30. </view>
  31. <view class="section agreement">
  32. <uv-checkbox-group
  33. v-model="checkboxValue"
  34. shape="circle"
  35. >
  36. <uv-checkbox
  37. size="36rpx"
  38. icon-size="36rpx"
  39. activeColor="#7451DE"
  40. :name="1"
  41. ></uv-checkbox>
  42. </uv-checkbox-group>
  43. <view class="desc">
  44. 我已阅读并同意
  45. <!-- todo: 替换配置项key -->
  46. <text class="highlight" @click="$refs.modal.open('config_privacy', '应用内支付用户协议')">应用内支付用户协议</text>
  47. <!-- todo: 替换配置项key -->
  48. <text class="highlight" @click="$refs.modal.open('config_agreement', '支付与隐私的声明')">支付与隐私的声明</text>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="flex footer">
  53. <button class="flex btn btn-cancel" @click="onCancel">暂不支付</button>
  54. <button class="flex btn btn-pay" @click="onPay">支付</button>
  55. </view>
  56. </view>
  57. </uv-popup>
  58. <agreementModal ref="modal" @confirm="onConfirmAgreement"></agreementModal>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. orderData: {}
  66. }
  67. },
  68. methods: {
  69. open(data) {
  70. const {
  71. title,
  72. orderId,
  73. amount,
  74. } = data
  75. this.orderData = {
  76. title,
  77. orderId,
  78. amount,
  79. }
  80. this.$refs.popup.open()
  81. console.log('orderData', this.orderData)
  82. },
  83. close() {
  84. this.$refs.popup.close()
  85. },
  86. onCancel() {
  87. // todo: jump to order list page?
  88. this.close()
  89. },
  90. onConfirmAgreement(confirm) {
  91. if (confirm) {
  92. this.checkboxValue = [1]
  93. } else {
  94. this.checkboxValue = []
  95. }
  96. },
  97. onPay() {
  98. // todo: pay
  99. // todo: jump to order list page
  100. this.$emit('submitted')
  101. },
  102. },
  103. }
  104. </script>
  105. <style lang="scss" scoped>
  106. .popup__view {
  107. width: 100vw;
  108. display: flex;
  109. flex-direction: column;
  110. box-sizing: border-box;
  111. background: #FFFFFF;
  112. border-top-left-radius: 32rpx;
  113. border-top-right-radius: 32rpx;
  114. }
  115. .header {
  116. position: relative;
  117. width: 100%;
  118. padding: 24rpx 0;
  119. box-sizing: border-box;
  120. border-bottom: 2rpx solid #EEEEEE;
  121. .title {
  122. font-family: PingFang SC;
  123. font-weight: 500;
  124. font-size: 34rpx;
  125. line-height: 1.4;
  126. color: #181818;
  127. }
  128. .btn {
  129. font-family: PingFang SC;
  130. font-weight: 500;
  131. font-size: 32rpx;
  132. line-height: 1.4;
  133. color: #8B8B8B;
  134. position: absolute;
  135. top: 26rpx;
  136. left: 40rpx;
  137. }
  138. }
  139. .main {
  140. padding: 64rpx 40rpx;
  141. }
  142. .section {
  143. margin-top: 24rpx;
  144. }
  145. .info {
  146. row-gap: 8rpx;
  147. &-title {
  148. font-family: PingFang SC;
  149. font-weight: 400;
  150. font-size: 28rpx;
  151. line-height: 1.4;
  152. color: #000000;
  153. }
  154. &-amount {
  155. font-family: PingFang SC;
  156. font-weight: 500;
  157. font-size: 24rpx;
  158. line-height: 1.4;
  159. color: #7451DE;
  160. .highlight {
  161. font-size: 64rpx;
  162. margin-left: 8rpx;
  163. }
  164. }
  165. }
  166. .payment {
  167. justify-content: space-between;
  168. box-sizing: border-box;
  169. padding: 24rpx 32rpx;
  170. background: #FAFAFF;
  171. box-shadow: -4rpx -4rpx 20rpx 0 #FFFFFFC4,
  172. 4rpx 4rpx 20rpx 0 #AAAACC1F,
  173. 2rpx 2rpx 4rpx 0 #AAAACC40,
  174. -2rpx -2rpx 4rpx 0 #FFFFFF;
  175. border-radius: 32rpx;
  176. &-icon {
  177. width: 56rpx;
  178. height: auto;
  179. }
  180. &-text {
  181. margin-left: 16rpx;
  182. font-family: PingFang SC;
  183. font-weight: 400;
  184. font-size: 28rpx;
  185. line-height: 1.5;
  186. color: #252545;
  187. }
  188. }
  189. .agreement {
  190. margin-top: 24rpx;
  191. display: flex;
  192. .desc {
  193. font-family: PingFang SC;
  194. font-size: 24rpx;
  195. font-weight: 400;
  196. line-height: 1.4;
  197. color: #8B8B8B;
  198. }
  199. .highlight {
  200. color: $uni-color;
  201. }
  202. }
  203. .footer {
  204. width: 100%;
  205. // todo:check
  206. // height: 214rpx;
  207. padding: 32rpx 40rpx;
  208. box-sizing: border-box;
  209. border-top: 2rpx solid #F1F1F1;
  210. column-gap: 32rpx;
  211. .btn {
  212. flex: 1;
  213. font-family: PingFang SC;
  214. font-weight: 500;
  215. font-size: 36rpx;
  216. line-height: 1.4;
  217. border-radius: 41rpx;
  218. &-cancel {
  219. padding: 14rpx 0;
  220. color: #252545;
  221. border: 2rpx solid #252545;
  222. }
  223. &-pay {
  224. padding: 16rpx 0;
  225. color: #FFFFFF;
  226. background-image: linear-gradient(to right, #4B348F, #845CFA);
  227. }
  228. }
  229. }
  230. </style>