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.

303 lines
6.4 KiB

9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
5 months ago
5 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
  1. <!-- 注册页面 -->
  2. <template>
  3. <view class="register bx">
  4. <div class="language">
  5. <image @click="showSelectLanguageProp" src="@/static/login/language.png" mode="aspectFit"></image>
  6. </div>
  7. <!-- 加载效果 -->
  8. <!-- <loading :loading="loading" @close="closeLoading"></loading> -->
  9. <view v-if="!loading" class="main">
  10. <!-- 登录标题 -->
  11. <view class="register-title">
  12. <view class="title">{{ $t('page.register.title') }}</view>
  13. <!-- <view class="shop-desc">Online rebate mall.</view> -->
  14. </view>
  15. <!-- 输入框列表 -->
  16. <view class="input-list">
  17. <input v-model="form.account" type="text" :placeholder="$t('page.register.phone-placeholder')" />
  18. <input v-model="form.password" type="password"
  19. :placeholder="$t('page.register.password-placeholder')" />
  20. <input v-model="form.payPass" type="password"
  21. :placeholder="$t('page.register.payPass-placeholder')" />
  22. <input v-model="form.invitationCode" :placeholder="$t('page.register.invitation-code-placeholder')" />
  23. </view>
  24. <!-- 勾选协议 -->
  25. <!-- <view class="check-box">
  26. <u-checkbox-group v-model="agree" @change="$play">
  27. <u-checkbox activeColor="#B0C73B" shape="circle" :label="$t('page.register.agreen')"
  28. name="agree"></u-checkbox>
  29. </u-checkbox-group>
  30. <view @click.stop="toAgreement" class="agreement-content">{{ $t('page.register.agreement') }}</view>
  31. </view> -->
  32. <!-- 按钮组 -->
  33. <view class="btns">
  34. <view @click.stop="register" class="now-register-btn">{{ $t('page.register.title') }}</view>
  35. <view @click.stop="toLogin" class="now-register-btn">{{ $t('page.register.login-now') }}</view>
  36. </view>
  37. </view>
  38. <!-- 切换语言 -->
  39. <changeLanguage :show.sync="showSelectLanguage" @close="closeSelectLanguageProp"></changeLanguage>
  40. <!-- 初始页面 -->
  41. <!-- <pageInit></pageInit> -->
  42. </view>
  43. </template>
  44. <script>
  45. import changeLanguage from '../../components/changeLanguage/changeLanguage.vue';
  46. import pageInit from '@/components/pageInit/pageInit.vue'
  47. import loading from '@/components/pageInit/loading.vue'
  48. export default {
  49. components: {
  50. changeLanguage,
  51. pageInit,
  52. loading
  53. },
  54. data() {
  55. return {
  56. form: {
  57. account: '',
  58. password: '',
  59. payPass: '',
  60. invitationCode: ''
  61. },
  62. agree: [],
  63. showSelectLanguage: false,
  64. loading: false
  65. }
  66. },
  67. onShow() {
  68. },
  69. methods: {
  70. //注册
  71. register() {
  72. //效验账号,必须包含字母
  73. if (!/[A-Za-z]/.test(this.form.account)) {
  74. uni.showToast({
  75. title: this.$t('page.register.accountError'),
  76. icon: 'none'
  77. });
  78. return false;
  79. }
  80. this.$play()
  81. if (this.verify()) {
  82. this.request('register', {}, this.form).then(res => {
  83. if (res.code == 200) {
  84. this.toLogin(false)
  85. }
  86. })
  87. }
  88. },
  89. //跳转登录页面
  90. toLogin(sound) { //是否发出声音
  91. if (sound) {
  92. this.$play()
  93. }
  94. uni.navigateTo({
  95. url: '/pages/login/login'
  96. })
  97. },
  98. //校验必填项
  99. verify() {
  100. let {
  101. account,
  102. password,
  103. payPass,
  104. invitationCode
  105. } = this.form
  106. if (account.trim() == '') {
  107. uni.showToast({
  108. title: this.$t('page.register.accountEmpty'),
  109. icon: 'none'
  110. });
  111. return false;
  112. }
  113. if (password.trim() == '') {
  114. uni.showToast({
  115. title: this.$t('page.register.passEmpty'),
  116. icon: 'none'
  117. });
  118. return false;
  119. }
  120. if (payPass.trim() == '') {
  121. uni.showToast({
  122. title: this.$t('page.register.payPassEmpty'),
  123. icon: 'none'
  124. });
  125. return false;
  126. }
  127. if(invitationCode.trim() == ''){
  128. uni.showToast({
  129. title: this.$t('page.register.invitationCodeEmpty'),
  130. icon: 'none'
  131. });
  132. return false;
  133. }
  134. // if (this.agree.length <= 0 && this.agree[0] != 'agree') {
  135. // uni.showToast({
  136. // title: this.$t('page.register.tickProtocol'),
  137. // icon: 'none'
  138. // });
  139. // return false;
  140. // }
  141. return true
  142. },
  143. //显示选择语言弹框
  144. showSelectLanguageProp() {
  145. this.$play()
  146. this.showSelectLanguage = true
  147. },
  148. //关闭语言选择弹框
  149. closeSelectLanguageProp() {
  150. this.showSelectLanguage = false
  151. },
  152. //关闭加载效果
  153. closeLoading() {
  154. this.loading = false;
  155. },
  156. //跳转用户协议
  157. toAgreement() {
  158. this.$play()
  159. uni.navigateTo({
  160. url: '/pages/instructions/instructions?index=4'
  161. })
  162. }
  163. }
  164. }
  165. </script>
  166. <style lang="scss" scoped>
  167. .register {
  168. width: 750rpx;
  169. height: 100vh;
  170. margin: 0px auto;
  171. background: linear-gradient(to bottom, #fcedff 0%, #ffffff 100%);
  172. background-size: 100%;
  173. background-repeat: no-repeat;
  174. box-sizing: border-box;
  175. padding: 0rpx 20rpx;
  176. .language {
  177. display: flex;
  178. justify-content: flex-end;
  179. align-items: center;
  180. height: 160rpx;
  181. image {
  182. width: 60rpx;
  183. height: 60rpx;
  184. }
  185. }
  186. .register-title {
  187. padding: 0rpx 10rpx;
  188. box-sizing: border-box;
  189. text-align: center;
  190. .title {
  191. font-size: 60rpx;
  192. color: $uni-bg-color-app;
  193. margin-bottom: 10rpx;
  194. font-weight: bold;
  195. }
  196. .shop-desc {
  197. font-size: 28rpx;
  198. color: #333;
  199. margin-bottom: 20rpx;
  200. }
  201. }
  202. .input-list {
  203. padding: 0rpx 10rpx;
  204. box-sizing: border-box;
  205. margin: 40rpx 0rpx;
  206. input {
  207. display: block;
  208. width: 90%;
  209. margin: 0rpx auto;
  210. color: $uni-bg-color-app;
  211. border: 1px solid #eeeeee;
  212. height: 80rpx;
  213. border-radius: 40rpx;
  214. background: #fff;
  215. margin-bottom: 20rpx;
  216. text-align: center;
  217. text-indent: 1em;
  218. padding: 0rpx 15rpx;
  219. &:focus {
  220. border-color: #6d00be !important;
  221. background: pink !important;
  222. }
  223. }
  224. }
  225. .forgot-password {
  226. color: #B0C73B;
  227. text-align: center;
  228. text {
  229. border-bottom: 1rpx solid #ccc;
  230. }
  231. }
  232. .check-box {
  233. display: flex;
  234. color: rgb(96, 98, 102);
  235. .agreement-content {
  236. text-decoration: underline;
  237. font-size: 28rpx;
  238. }
  239. }
  240. .btns {
  241. padding: 0rpx 10rpx;
  242. margin-top: 40rpx;
  243. color: $uni-bg-color;
  244. .now-register-btn {
  245. background: $uni-bg-color-app;
  246. border-radius: 60rpx;
  247. display: flex;
  248. align-items: center;
  249. justify-content: center;
  250. margin-bottom: 20rpx;
  251. font-weight: bold;
  252. height: 90rpx;
  253. font-size: 40rpx;
  254. }
  255. .now-login-btn {
  256. display: flex;
  257. justify-content: center;
  258. align-items: center;
  259. color: $uni-bg-color-app;
  260. }
  261. }
  262. }
  263. </style>