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.

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