user-upgrade-application.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <view class="user-upgrade-application-container">
  3. <FieldPaneUUA
  4. ref="refFieldPaneUUA" v-model="form.basicInfo" :fields="applyUserUpgradeOne" title="申请表单"
  5. :user-info="userInfo" @unlock="handleUnlock"
  6. ></FieldPaneUUA>
  7. <view
  8. v-if="isShowBottomBtn"
  9. style="position: fixed;bottom: 0;z-index: 1;display: flex;justify-content: space-between;width: 100%;padding: 18upx;background-color: #ffffff;box-sizing: border-box;"
  10. >
  11. <tui-button
  12. type="black" width="330upx" height="104upx" margin="20upx 0"
  13. plain
  14. style="font-weight: bold;border-radius: 10upx;" @click="handleBack"
  15. >
  16. 点击取消
  17. </tui-button>
  18. <tui-button
  19. type="warning" width="330upx" height="104upx" margin="20upx 0"
  20. style="font-weight: bold;color: #F5CEA8;background: #2C2B30!important;border-radius: 10upx;" @click="submit"
  21. >
  22. 确认升级
  23. </tui-button>
  24. </view>
  25. <tui-landscape
  26. :show="displayBadgesMsg.isShowBadges" :position="1" mask mask-closable
  27. :icon-size="28"
  28. icon-color="#FFFFFF" @close="handleCloseBadges"
  29. >
  30. <view style="position: relative;">
  31. <view v-if="displayBadgesMsg.name" class="rotation-box"></view>
  32. <view style="position: relative;max-height: 75vh;overflow-y: auto;">
  33. <image
  34. style="position: absolute;top: 180upx;left: 50%;transform: translateX(-50%);width: 174upx;height: 174upx;border-radius: 40upx;"
  35. :src="common.seamingImgUrl($store.getters.userInfo.headImage) || require('../../../static/images/new-user/default-user-avatar.png')"
  36. >
  37. </image>
  38. <image src="../../../static/images/user/displayBadges/glory-frame.png" mode="widthFix" style="width: 500upx;" />
  39. <view
  40. style="width: 304upx;margin: 4upx auto 0;padding: 18upx;color: #fff;font-weight: bold;text-align: center;vertical-align: bottom;background: linear-gradient(180deg, #feb623 0%, #e8120c 100%);border: 2upx solid #FFDBAB;border-radius: 50upx;"
  41. >
  42. <text>恭喜你成为{{ displayBadgesMsg.name }}</text>
  43. </view>
  44. </view>
  45. </view>
  46. </tui-landscape>
  47. </view>
  48. </template>
  49. <script>
  50. import { T_STORAGE_KEY } from '../../../constant'
  51. import FieldPaneUUA from './components/field-pane-uua.vue'
  52. import { addPlatformRelationshipApplyApi } from '../../../api/anotherTFInterface'
  53. export default {
  54. name: 'UserUpgradeApplication',
  55. components: {
  56. FieldPaneUUA
  57. },
  58. onLoad(options) {
  59. this.userInfo = uni.getStorageSync(T_STORAGE_KEY) || {}
  60. this.form.basicInfo.phone = this.userInfo.phone || ''
  61. },
  62. data() {
  63. return {
  64. userInfo: {},
  65. applyUserUpgradeOne: [
  66. {
  67. label: '区域',
  68. field: 'region',
  69. type: 'area',
  70. placeholder: '选择您的区域 >'
  71. },
  72. {
  73. label: '详细地址(门牌号)',
  74. type: 'textarea',
  75. field: 'address',
  76. placeholder: '请填写详细地址'
  77. },
  78. {
  79. label: '姓名',
  80. field: 'name',
  81. type: 'input',
  82. placeholder: '填写您的姓名'
  83. },
  84. {
  85. label: '手机号',
  86. type: 'input',
  87. field: 'phone',
  88. placeholder: '请填写您的手机号'
  89. },
  90. {
  91. label: '会员类型:',
  92. field: 'relationshipLevelId', // 5-区代理 4-加盟商 3-合伙人 2-团长 1-会员
  93. type: 'select',
  94. placeholder: '请选择会员类型'
  95. }
  96. ],
  97. form: {
  98. basicInfo: {
  99. relationshipLevelId: '',
  100. region: '',
  101. address: '',
  102. name: '',
  103. phone: ''
  104. }
  105. },
  106. isShowBottomBtn: false,
  107. displayBadgesMsg: {
  108. name: '',
  109. isShowBadges: false
  110. }
  111. }
  112. },
  113. methods: {
  114. // 点击提交按钮
  115. submit() {
  116. console.log(this.$refs.refFieldPaneUUA)
  117. const data = {
  118. ...this.form.basicInfo
  119. }
  120. if (!data.region) {
  121. this.$showToast('请选择所在区域')
  122. return
  123. }
  124. if (!data.relationshipLevelId) {
  125. this.$showToast('缺少会员类型')
  126. return
  127. }
  128. if (!data.name) {
  129. this.$showToast('请填写姓名')
  130. return
  131. }
  132. if (
  133. !/^1[3456789]\d{9}$/.test(data.phone)
  134. ) {
  135. this.$showToast('手机号码格式错误')
  136. return
  137. }
  138. if (!data.address) {
  139. this.$showToast('请填写详细地址')
  140. return
  141. }
  142. uni.showModal({
  143. title: '提示',
  144. content: '确认提交会员升级申请?',
  145. success: (res) => {
  146. if (res.confirm) {
  147. addPlatformRelationshipApplyApi(data).then((res) => {
  148. // this.$showToast('升级成功,恭喜你!')
  149. this.displayBadgesMsg.name = this.$refs.refFieldPaneUUA.relationshipLevelName
  150. this.displayBadgesMsg.isShowBadges = true
  151. // setTimeout(() => {
  152. // // uni.navigateBack()
  153. // this.$switchTab('/')
  154. // }, 3000)
  155. })
  156. }
  157. }
  158. })
  159. },
  160. handleCloseBadges() {
  161. this.displayBadgesMsg.isShowBadges = false
  162. this.displayBadgesMsg.name = ''
  163. this.form.basicInfo.relationshipLevelId = ''
  164. this.form.basicInfo.region = ''
  165. this.form.basicInfo.address = ''
  166. this.form.basicInfo.name = ''
  167. this.isShowBottomBtn = false
  168. this.$refs.refFieldPaneUUA.relationshipLevelName = ''
  169. this.$refs.refFieldPaneUUA.relationLevelName = ''
  170. this.$refs.refFieldPaneUUA.upgradeLevelType = ''
  171. this.$refs.refFieldPaneUUA.isShowLock = true
  172. this.$refs.refFieldPaneUUA.relationshipLevelList = []
  173. this.$refs.refFieldPaneUUA.isShowRelationshipLevelSelect = false
  174. this.$refs.refFieldPaneUUA.regionName = ''
  175. this.$refs.refFieldPaneUUA.handleInitUpgradeInfo()
  176. },
  177. handleBack() {
  178. uni.navigateBack()
  179. },
  180. handleUnlock() {
  181. this.isShowBottomBtn = true
  182. }
  183. }
  184. }
  185. </script>
  186. <style lang="less" scoped>
  187. .rotation-box {
  188. position: absolute;
  189. top: -45vh;
  190. left: 50%;
  191. margin-left: -60vh;
  192. display: block;
  193. width: 120vh;
  194. height: 120vh;
  195. opacity: 0.4;
  196. background: repeating-conic-gradient(from 0deg, white 0deg 19deg, transparent 15deg 53deg);
  197. mask-image: radial-gradient(rgb(0, 0, 0), rgb(0, 0, 0) 50%);
  198. animation: rotate 20s linear infinite;
  199. }
  200. @keyframes rotate {
  201. to {
  202. transform: rotate(1turn)
  203. }
  204. }
  205. .user-upgrade-application-container {
  206. width: 100%;
  207. min-height: 100vh;
  208. // padding: 40upx 40upx 140upx 40upx;
  209. padding-bottom: 184upx;
  210. background-color: #f5f4f9;
  211. box-sizing: border-box;
  212. position: relative;
  213. .buts {
  214. position: fixed;
  215. bottom: -1px;
  216. z-index: 2;
  217. padding: 20upx 40upx;
  218. left: 0;
  219. display: flex;
  220. justify-content: center;
  221. align-items: center;
  222. background-color: #fff;
  223. width: 100%;
  224. box-sizing: border-box;
  225. margin-top: 272upx;
  226. }
  227. .btn {
  228. display: flex;
  229. justify-content: center;
  230. align-items: center;
  231. height: 72upx;
  232. width: 306upx;
  233. font-size: 32upx;
  234. color: #fff;
  235. margin: 0;
  236. background-color: #07b9b9;
  237. border-radius: 100px;
  238. &:last-child {
  239. background-color: #fa5151;
  240. }
  241. }
  242. }
  243. </style>