推广小程序前端代码
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.

144 lines
5.2 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
1 month ago
2 months ago
2 months ago
1 month ago
2 months ago
2 months ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
  1. <template>
  2. <view class="invoiceIssuance">
  3. <view class="head-box"></view>
  4. <Navbar title="申请开票" :autoBack="true" :bgColor="bgColor" leftIconSize="18px" height="100rpx" :leftIconColor="leftIconColor" :titleStyle="{color:fontColor}" />
  5. <view class="content contentPosition_">
  6. <view class="info cardStyle_">
  7. <view class="left">
  8. <image src="https://img0.baidu.com/it/u=4274003247,920124130&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1031" alt="">
  9. </view>
  10. <view class="right">
  11. <view class="detailed">
  12. <view class="title">{{activityItem.title}}</view>
  13. <view class="date">{{activityItem.startTime}}</view>
  14. <view class="address">{{activityItem.address}}</view>
  15. </view>
  16. <view class="price"><text>总计</text>¥{{activityItem.price}}</view>
  17. </view>
  18. </view>
  19. <view class="choice">
  20. <uv-radio-group
  21. siz="300"
  22. labelSize="25rpx"
  23. iconSize="25rpx"
  24. v-model="radioValue"
  25. placement="column"
  26. shape="square"
  27. labelColor="#fff"
  28. activeColor="#FF4546"
  29. iconPlacement="right">
  30. <uv-radio name="0" label="个人"></uv-radio>
  31. <uv-radio name="1" label="企业"></uv-radio>
  32. </uv-radio-group>
  33. </view>
  34. <view class="iptInfo" v-if="radioValue">
  35. <uv-form-item :label="radioValue === '0' ? '姓名' : '企业名称'" labelWidth="180rpx" borderBottom>
  36. <uv-input placeholder="请输入内容" fontSize="29rpx" color="#fff" v-model="invoicingInfo.name" border="none"></uv-input>
  37. </uv-form-item>
  38. <uv-form-item :label="radioValue === '0' ? '身份证号' : '税号'" labelWidth="180rpx" borderBottom>
  39. <uv-input placeholder="请输入内容" fontSize="29rpx" color="#fff" v-model="invoicingInfo.no" border="none"></uv-input>
  40. </uv-form-item>
  41. <uv-form-item label="邮箱" labelWidth="180rpx" borderBottom>
  42. <uv-input placeholder="请输入内容" fontSize="29rpx" color="#fff" v-model="invoicingInfo.emil" border="none"></uv-input>
  43. </uv-form-item>
  44. </view>
  45. <view style="padding: 0 35rpx 65rpx;">
  46. <uv-button @click="toInvoiceRecords" :custom-style="customStyle" type="primary" shape="circle" color="#381615" text="申请"></uv-button>
  47. </view>
  48. <uv-toast ref="toast"></uv-toast>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import Navbar from '@/pages/components/Navbar.vue'
  54. import { globalMixin } from '../pages/mixins/globalMixin';
  55. export default{
  56. mixins: [globalMixin],
  57. components:{
  58. Navbar
  59. },
  60. data() {
  61. return {
  62. orderId: '',
  63. radioValue: '0',
  64. invoicingInfo: {
  65. name: '',
  66. no: '',
  67. emil: ''
  68. },
  69. activityItem:{}
  70. }
  71. },
  72. onLoad({orderId}) {
  73. this.orderId = orderId
  74. console.log("发票标识:"+orderId)
  75. this.toOrderDetails("orderId");
  76. },
  77. methods: {
  78. //查询订单详情信息
  79. toOrderDetails(orderId) {
  80. this.$api('orderInfo',{orderId:this.orderId},res=>{
  81. if(res.code == 200) {
  82. this.activityItem = res.result.orderDetails
  83. }
  84. })
  85. },
  86. toInvoiceRecords() {
  87. let params = {}
  88. params = this.invoicingInfo;
  89. params.orderId = this.orderId
  90. console.log(params);
  91. this.$api('invoice', params, res=> {
  92. if (res.code == 200) {
  93. this.$refs.toast.show({
  94. type: 'success',
  95. message: res.result
  96. })
  97. setTimeout(uni.redirectTo, 800, {
  98. url: '/pages_order/invoiceRecords'
  99. })
  100. }
  101. })
  102. }
  103. }
  104. }
  105. </script>
  106. <style scoped lang="scss">
  107. .invoiceIssuance {
  108. .content {
  109. margin-top: 40rpx;
  110. .info {
  111. margin: 10rpx 32rpx 0rpx;
  112. border-radius: 26rpx;
  113. }
  114. .choice {
  115. /deep/.uv-radio-group {
  116. margin: 32px 32rpx 40rpx;
  117. .uv-radio {
  118. color: #fff;
  119. padding: 45rpx 35rpx;
  120. background: $uni-color-card-background;
  121. border-radius: 26rpx;
  122. margin-bottom: 16rpx;
  123. }
  124. .uv-radio__icon-wrap {
  125. width: 32rpx!important;
  126. height: 32rpx!important;
  127. }
  128. }
  129. }
  130. .iptInfo {
  131. background: $uni-color-card-background;
  132. padding: 41rpx 46rpx 60rpx;
  133. margin: 32px 32rpx 40rpx;
  134. border-radius: 26rpx;
  135. /deep/.uv-form-item__body__left__content__label {
  136. color: #fff!important;
  137. font-size: 32rpx;
  138. }
  139. }
  140. }
  141. }
  142. </style>