Step1.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <member-base :show="false"><view class="div container">
  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. <image mode="aspectFit" class="img back" :src="sellerjoininback" :style="'width:'+getBannerStyle.width+'px;height:'+getBannerStyle.height+'px'">
  13. <view class="div wrapper mt-20" v-if="config && config.store_joinin_open!=0">
  14. <view class="div btn-wrapper">
  15. <view v-if="config.store_joinin_open==1 || config.store_joinin_open==3" class="div common-btn ds-button-large btn" @click="nextStep(1)">个人入驻</view>
  16. <view v-if="config.store_joinin_open==1 || config.store_joinin_open==2" class="div common-btn ds-button-large btn" @click="nextStep(0)">企业入驻</view>
  17. </view>
  18. <view class="div">
  19. <checkbox-group @change="checkboxChange">
  20. <view v-for="(item,index) in options" :key="index">
  21. <checkbox :value="item.value" :checked="value==item.value" />
  22. <text @click="onAgreement()">{{item.label}}</text>
  23. </view>
  24. </checkbox-group>
  25. </view>
  26. </view>
  27. </view>
  28. <uni-popup background-color="#fff" ref="confirm" type="dialog">
  29. <uni-popup-dialog :mode="dialog.mode" :title="dialog.title" :content="dialog.content" :placeholder="dialog.content" @confirm="confirmDialog" @close="closeDialog"></uni-popup-dialog>
  30. </uni-popup>
  31. </member-base>
  32. </template>
  33. <script>
  34. import {getFontSize} from '@/util/common'
  35. import TitleHeader from '../../TitleHeader'
  36. import { urlencode } from '@/util/common'
  37. import { env } from '../../../static/config'
  38. import MemberBase from '../MemberBase'
  39. import { mapState, mapMutations, mapActions } from 'vuex'
  40. import { getStoreJoinin } from '../../../api/seller'
  41. export default {
  42. components:{
  43. TitleHeader,
  44. MemberBase,
  45. },
  46. data(){
  47. return {
  48. navHeight: 0,
  49. dialog:{},
  50. options: [{ label: '《同意商家入驻协议》', value: '1' }],
  51. value: [1],
  52. sellerjoininback: env.SITE_URL + "/uploads/home/h5/sellerjoinin_back.png"
  53. }
  54. },
  55. mounted(){
  56. // #ifdef MP-WEIXIN
  57. this.navHeight = uni.getMenuButtonBoundingClientRect().top
  58. // #endif
  59. },
  60. computed:{
  61. fontSize(){
  62. return getFontSize()
  63. },
  64. ...mapState({
  65. config: state => state.config.config
  66. }),
  67. getBannerStyle: function () {
  68. const res = uni.getSystemInfoSync()
  69. var width = res.windowWidth
  70. var height = res.windowHeight
  71. let itemWidth = width
  72. let itemHeight = width * (612 / 500)
  73. return {
  74. width: itemWidth,
  75. height: itemHeight
  76. }
  77. },
  78. },
  79. created: function () {
  80. this.fetchConfig({}).then(
  81. response => {
  82. },
  83. error => {
  84. uni.showToast({icon:'none',title: error.message})
  85. }
  86. )
  87. getStoreJoinin().then(res => {
  88. var store_joinin = res.result.store_joinin
  89. if (store_joinin) {
  90. this.sellerJoininSave({ storeJoinin: store_joinin })
  91. if(store_joinin.joinin_state == 30){
  92. this.dialog={title:'初审失败',content:store_joinin.joinin_message}
  93. this.$refs.confirm.open()
  94. }
  95. if (store_joinin.joinin_state == 10 || store_joinin.joinin_state == 11 || store_joinin.joinin_state == 20 || store_joinin.joinin_state == 31) {
  96. uni.redirectTo({ url: '/pages/member/sellerjoinin/Step5' })
  97. return
  98. }
  99. if (store_joinin.joinin_state == 40) {
  100. uni.showToast({icon:'none',title: '您的店铺已开通'})
  101. return
  102. }
  103. }
  104. }).catch(error => {
  105. uni.showToast({icon:'none',title: error.message})
  106. })
  107. },
  108. methods:{
  109. checkboxChange(e){
  110. this.value = e.detail.value;
  111. },
  112. closeDialog(){
  113. },
  114. confirmDialog(value){
  115. },
  116. goBack(){uni.navigateBack({delta:1})},
  117. ...mapActions({
  118. fetchConfig: 'fetchConfig'
  119. }),
  120. ...mapMutations({
  121. sellerJoininSave: 'sellerJoininSave',
  122. sellerJoininTypeSave: 'sellerJoininTypeSave'
  123. }),
  124. nextStep (type) {
  125. this.sellerJoininTypeSave({ storeJoininType: type })
  126. uni.redirectTo({ url: '/pages/member/sellerjoinin/Step2' })
  127. },
  128. onAgreement () {
  129. uni.navigateTo({ url: '/pages/home/article/Document'+'?'+urlencode( { type: 'open_store' })})
  130. }
  131. }
  132. }
  133. </script>
  134. <style lang="scss" scoped>
  135. .common-header-wrap .common-header{box-shadow: unset}
  136. .container {
  137. background: #fff;
  138. }
  139. .back{width:100%}
  140. .btn-wrapper{display: flex;padding:0 .5rem}
  141. .btn{margin:0 .5rem;flex:1}
  142. </style>