Step3.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <member-base :show="false"><view class="div">
  3. <view class="div common-header-wrap">
  4. <view :style="'height:'+navHeight+'px'"></view>
  5. <view class="common-header-holder"></view>
  6. <view class="common-header-fixed">
  7. <title-header />
  8. <uni-nav-bar title="店铺入驻" class="common-header" left-icon="back" @clickLeft="goBack()">
  9. </uni-nav-bar>
  10. </view>
  11. </view>
  12. <step :options="options" :active="1"></step>
  13. <view class="div" v-if="storeJoinin.store_type==0">
  14. <view class="div">
  15. <view class="div label">开户银行信息</view>
  16. <view class="div main-content">
  17. <flex-line class="field-line" :show-border="true"><text class="span field-name">银行开户名</text><view class="div field-line-right" slot="right"><input class="field-input" v-model="storeJoinin.bank_account_name" /></view></flex-line>
  18. <flex-line class="field-line" :show-border="true"><text class="span field-name">公司银行账号</text><view class="div field-line-right" slot="right"><input class="field-input" v-model="storeJoinin.bank_account_number" /></view></flex-line>
  19. <flex-line class="field-line" :show-border="true"><text class="span field-name">银行支行名称</text><view class="div field-line-right" slot="right"><input class="field-input" v-model="storeJoinin.bank_name" /></view></flex-line>
  20. <view class="div" @click="onRegion('bank_address')"><flex-line :is-link="true" :show-border="true"><text class="span line-name">银行所在地</text><text class="span" slot="right">{{storeJoinin.bank_address}}</text></flex-line></view>
  21. <flex-line :show-border="true"><text class="span line-name">此账号为结算账号</text><view class="div" slot="right"><switch @change="switchChange" :checked="!!isSame"></switch></view></flex-line>
  22. </view>
  23. </view>
  24. <view class="div" v-if="!isSame">
  25. <view class="div label">结算账号信息</view>
  26. <view class="div main-content">
  27. <flex-line class="field-line" :show-border="true"><text class="span field-name">银行开户名</text><view class="div field-line-right" slot="right"><input class="field-input" v-model="storeJoinin.settlement_bank_account_name" /></view></flex-line>
  28. <flex-line class="field-line" :show-border="true"><text class="span field-name">公司银行账号</text><view class="div field-line-right" slot="right"><input class="field-input" v-model="storeJoinin.settlement_bank_account_number" /></view></flex-line>
  29. <flex-line class="field-line" :show-border="true"><text class="span field-name">银行支行名称</text><view class="div field-line-right" slot="right"><input class="field-input" v-model="storeJoinin.settlement_bank_name" /></view></flex-line>
  30. <view class="div" @click="onRegion('settlement_bank_address')"><flex-line :is-link="true" :show-border="true"><text class="span line-name">银行所在地</text><text class="span" slot="right">{{storeJoinin.settlement_bank_address}}</text></flex-line></view>
  31. </view>
  32. </view>
  33. </view>
  34. <view v-else class="div main-content">
  35. <flex-line class="field-line" :show-border="true"><text class="span field-name">支付宝姓名</text><view class="div field-line-right" slot="right"><input class="field-input" v-model="storeJoinin.settlement_bank_account_name" /></view></flex-line>
  36. <flex-line class="field-line" :show-border="true"><text class="span field-name">支付宝账号</text><view class="div field-line-right" slot="right"><input class="field-input" v-model="storeJoinin.settlement_bank_account_number" /></view></flex-line>
  37. </view>
  38. <view class="div common-btn ds-button-large mt-10" @click="nextStep">下一步</view>
  39. <view class="div">
  40. <region-picker ref="picker" @onConfirm="onPickerConfirm"></region-picker>
  41. </view>
  42. </view></member-base>
  43. </template>
  44. <script>
  45. import {getFontSize} from '@/util/common'
  46. import TitleHeader from '../../TitleHeader'
  47. import MemberBase from '../MemberBase'
  48. import { mapState, mapMutations, mapActions } from 'vuex'
  49. import RegionPicker from '../../RegionPicker'
  50. import Step from '../../Step'
  51. import { getStoreJoinin, saveStoreJoinin3 } from '../../../api/seller'
  52. import flexLine from '../../flexLine'
  53. export default {
  54. components:{
  55. TitleHeader,
  56. MemberBase,
  57. flexLine,
  58. Step,
  59. RegionPicker
  60. },
  61. data(){
  62. return {
  63. navHeight: 0,
  64. isSame: false,
  65. regionName: '',
  66. options: [{ title: '公司资质' }, { title: '财务资质' }, { title: '店铺信息' }, { title: '合同签订' }]
  67. }
  68. },
  69. mounted(){
  70. // #ifdef MP-WEIXIN
  71. this.navHeight = uni.getMenuButtonBoundingClientRect().top
  72. // #endif
  73. },
  74. computed:{
  75. fontSize(){
  76. return getFontSize()
  77. },
  78. ...mapState({
  79. storeJoinin1: state => state.member.storeJoinin1,
  80. storeJoinin0: state => state.member.storeJoinin0,
  81. storeJoininType: state => state.member.storeJoininType,
  82. config: state => state.config.config
  83. }),
  84. storeJoinin:function(){
  85. if(this.storeJoininType==1){
  86. return this.storeJoinin1
  87. }else{
  88. return this.storeJoinin0
  89. }
  90. },
  91. },
  92. created: function () {
  93. this.isSame = !!this.storeJoinin.is_settlement_account
  94. getStoreJoinin().then(res => {
  95. var store_joinin = res.result.store_joinin
  96. if (store_joinin) {
  97. if (store_joinin.joinin_state == 11 || store_joinin.joinin_state == 20 || store_joinin.joinin_state == 31) {
  98. uni.redirectTo({url:'/pages/member/sellerjoinin/Step5'})
  99. return
  100. }
  101. if (store_joinin.joinin_state == 40) {
  102. uni.showToast({icon:'none',title: '您的店铺已开通'})
  103. return
  104. }
  105. // if (!this.storeJoinin) {
  106. this.isSame = !!this.storeJoinin.is_settlement_account
  107. this.sellerJoininSave({ storeJoinin: store_joinin })
  108. this.fetchConfig({}).then(
  109. response => {
  110. if(this.config.store_joinin_open==2 || this.config.store_joinin_open==3){
  111. if(this.config.store_joinin_open==3){
  112. this.storeJoinin['store_type']=1
  113. }
  114. if(this.config.store_joinin_open==2){
  115. this.storeJoinin['store_type']=0
  116. }
  117. this.$forceUpdate()
  118. }
  119. },
  120. error => {
  121. uni.showToast({icon:'none',title: error.message})
  122. }
  123. )
  124. // }
  125. }
  126. }).catch(error => {
  127. uni.showToast({icon:'none',title: error.message})
  128. })
  129. },
  130. methods:{
  131. switchChange(e){
  132. this.isSame=e.detail.value
  133. },
  134. goBack(){uni.navigateBack({delta:1})},
  135. ...mapActions({
  136. fetchConfig: 'fetchConfig',
  137. }),
  138. ...mapMutations({
  139. memberPoint: 'memberPoint',
  140. sellerJoininSave: 'sellerJoininSave'
  141. }),
  142. nextStep () {
  143. this.storeJoinin.is_settlement_account = this.isSame
  144. saveStoreJoinin3(this.storeJoinin).then(res => {
  145. this.sellerJoininSave({ storeJoinin: this.storeJoinin })
  146. uni.redirectTo({url:'/pages/member/sellerjoinin/Step4'})
  147. }).catch(error => {
  148. uni.showToast({icon:'none',title: error.message})
  149. })
  150. },
  151. onPickerConfirm (values) {
  152. if (this.regionName == 'bank_address') {
  153. this.storeJoinin.bank_address = this.getRegionStr(values)
  154. }
  155. if (this.regionName == 'settlement_bank_address') {
  156. this.storeJoinin.settlement_bank_address = this.getRegionStr(values)
  157. }
  158. this.$forceUpdate()
  159. },
  160. onRegion (name) {
  161. this.regionName = name
  162. this.$refs.picker.show()
  163. },
  164. getRegionStr (values) {
  165. let title = ''
  166. for (let i = 0; i < values.length; i++) {
  167. const element = values[i]
  168. if (i !== 0) {
  169. title = title + ' ' + element.area_name
  170. } else {
  171. title = title + element.area_name
  172. }
  173. }
  174. return title
  175. }
  176. }
  177. }
  178. </script>
  179. <style lang="scss" scoped>
  180. .main-content{background: #fff;padding:0 $pageSpace}
  181. .container {
  182. background: #fff;
  183. }
  184. .label {
  185. padding: .5rem;
  186. font-size:$h2;
  187. background: #eee;
  188. }
  189. </style>