推广小程序前端代码
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.

357 lines
7.9 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <view class="refundsOrExchange">
  3. <navbar :title="titleList[titleIndex]" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="frame">
  5. <!-- 登录和注册 -->
  6. <view class="loginRegister" v-if='titleIndex!=2'>
  7. <!-- 标题 -->
  8. <view class="title">{{titleList[titleIndex]}}</view>
  9. <!-- 头像 -->
  10. <view class="userIamge">
  11. <view>
  12. <img src="/static/image/center/11.svg" alt="" style="width: 100%;height: 100%;">
  13. </view>
  14. </view>
  15. <!-- 用户名&密码&隐私条款 -->
  16. <view class="form">
  17. <view>
  18. <uv-input v-model="form.account" placeholder="请输入账号" border="surround" shape='circle'
  19. clearable :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
  20. </view>
  21. <view>
  22. <uv-input v-model="form.password" password placeholder="请输入密码" border="surround" shape='circle'
  23. clearable :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
  24. </view>
  25. <view>
  26. <uv-checkbox-group v-model="checkboxValue" shape="circle">
  27. <view class="content">
  28. <view style="display: flex;flex-wrap: wrap;">
  29. <uv-checkbox size="30rpx" :name="1"></uv-checkbox>
  30. 请你阅读并同意我们的<span style="color: #fd5100"
  31. @click="jump(1)">隐私条款</span><span
  32. style="color: #fd5100"
  33. @click="jump(2)">用户协议</span>
  34. </view>
  35. </view>
  36. </uv-checkbox-group>
  37. </view>
  38. </view>
  39. </view>
  40. <!-- 忘记密码 -->
  41. <view class='forgetPassword' v-if='titleIndex==2'>
  42. <!-- 标题 -->
  43. <view class="title">{{titleList[titleIndex]}}</view>
  44. <!-- 表单 -->
  45. <view class="form1">
  46. <view class="userName">
  47. <uv-input v-model="form1.userName" placeholder="请输入手机号/用户/邮箱" border="surround" shape='circle'
  48. clearable :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
  49. </view>
  50. <view class="code">
  51. <view class="left">
  52. <uv-input v-model="form1.code" placeholder="请输入验证码" border="surround" shape='circle'
  53. clearable :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
  54. </view>
  55. <view class="right">
  56. <view>
  57. <uv-toast ref="toast"></uv-toast>
  58. <uv-code :seconds="seconds" @end="end" @start="start" ref="code"
  59. @change="codeChange"></uv-code>
  60. <uv-button @tap="getCode" iconSize='10rpx' color='#fd5100'
  61. shape='circle'>{{tips}}</uv-button>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="password1">
  66. <uv-input v-model="form1.password1" placeholder="设置您的新密码(6到50个字符)" password clearable
  67. border="surround" shape='circle' :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
  68. </view>
  69. <view class="password2">
  70. <uv-input v-model="form1.password2" placeholder="重新确认密码" password clearable border="surround"
  71. shape='circle' :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
  72. </view>
  73. </view>
  74. </view>
  75. <!-- 按钮 -->
  76. <view class="btn"
  77. @click="submit">
  78. <button class='a'>{{titleList[titleIndex]}}</button>
  79. </view>
  80. <!-- tab -->
  81. <!-- <view class="bottomTab">
  82. <span :class="titleIndex==0 ? 'tabbarItemActive' : 'tabbarItemNoActive'"
  83. @click='changePage(0)'>注册账号</span>
  84. <span style="color: #9c9fa4">|</span>
  85. <span :class="titleIndex==1 ? 'tabbarItemActive' : 'tabbarItemNoActive'"
  86. @click='changePage(1)'>账号登录</span>
  87. <span style="color: #9c9fa4">|</span>
  88. <span :class="titleIndex==2 ? 'tabbarItemActive' : 'tabbarItemNoActive'"
  89. @click='changePage(2)'>忘记密码</span>
  90. </view> -->
  91. </view>
  92. <configPopup ref="popup"></configPopup>
  93. </view>
  94. </template>
  95. <script>
  96. import configPopup from '@/components/config/configPopup.vue';
  97. export default {
  98. components: {
  99. configPopup
  100. },
  101. onLoad(option) {
  102. this.titleIndex = option.index || 1
  103. },
  104. data() {
  105. return {
  106. titleIndex: 0,
  107. titleList: ['注册', '登录', '重置密码'],
  108. checkboxValue: [],
  109. form: {
  110. account: '13135294009',
  111. password: 'lzx123456',
  112. },
  113. form1: {
  114. userName: '',
  115. code: '',
  116. password1: '',
  117. password2: '',
  118. },
  119. tips: '获取验证码',
  120. seconds: 60,
  121. }
  122. },
  123. methods: {
  124. jump(type) {//1 隐私协议 2服务条款
  125. if(type == 1) {
  126. uni.navigateTo({
  127. url:'/pages_login/yinsixieyi'
  128. })
  129. }else {
  130. uni.navigateTo({
  131. url:'/pages_login/fuwutiaokuan'
  132. })
  133. }
  134. },
  135. submit(){
  136. if(!this.checkboxValue.length){
  137. return uni.showToast({
  138. title: '请先同意隐私协议',
  139. icon:'none'
  140. })
  141. }
  142. if(this.$utils.verificationAll(this.form, {
  143. account: '请输入账号',
  144. password: '请输入密码',
  145. })){
  146. return
  147. }
  148. this.$store.commit('accountLogin', this.form)
  149. },
  150. // 切换页面
  151. changePage(index) {
  152. this.titleIndex = index
  153. },
  154. confirm() {
  155. },
  156. codeChange(text) {
  157. this.tips = text;
  158. },
  159. getCode() {
  160. if (this.$refs.code.canGetCode) {
  161. // 模拟向后端请求验证码
  162. uni.showLoading({
  163. title: '正在获取验证码'
  164. })
  165. setTimeout(() => {
  166. uni.hideLoading();
  167. // 这里此提示会被this.start()方法中的提示覆盖
  168. uni.$uv.toast('验证码已发送');
  169. // 通知验证码组件内部开始倒计时
  170. this.$refs.code.start();
  171. }, 2000);
  172. } else {
  173. uni.$uv.toast('请勿重复发送');
  174. }
  175. },
  176. end() {
  177. // uni.$uv.toast('倒计时结束');
  178. },
  179. start() {
  180. // uni.$uv.toast('倒计时开始');
  181. }
  182. }
  183. }
  184. </script>
  185. <style lang="scss" scoped>
  186. * {
  187. box-sizing: border-box;
  188. }
  189. .refundsOrExchange {
  190. background-color: #FFF;
  191. height: 100vh;
  192. .frame {
  193. background-color: #FFF;
  194. .loginRegister {
  195. display: flex;
  196. flex-direction: column;
  197. gap: 40rpx;
  198. .title {
  199. display: flex;
  200. justify-content: center;
  201. align-items: flex-end;
  202. height: 10vh;
  203. color: #000;
  204. font-size: 40rpx;
  205. font-weight: 700;
  206. }
  207. .userIamge {
  208. display: flex;
  209. justify-content: center;
  210. height: 10vh;
  211. >view:nth-of-type(1) {
  212. width: 25%;
  213. height: 100%;
  214. border-radius: 50%;
  215. overflow: hidden;
  216. }
  217. }
  218. .form {
  219. line-height: 50rpx;
  220. >view:nth-of-type(1) {
  221. padding: 20rpx 100rpx;
  222. }
  223. >view:nth-of-type(2) {
  224. padding: 0 100rpx;
  225. }
  226. >view:nth-of-type(3) {
  227. display: flex;
  228. padding: 30rpx 100rpx 0 100rpx;
  229. font-size: 22rpx
  230. }
  231. }
  232. }
  233. .btn {
  234. // height: 5vh;
  235. display: flex;
  236. justify-content: center;
  237. margin: 90rpx 0 0 0;
  238. .a {
  239. display: flex;
  240. justify-content: center;
  241. align-items: center;
  242. width: 70%;
  243. height: 80rpx;
  244. color: #FFF;
  245. background-color: $uni-color;
  246. border: 1px solid red;
  247. border-radius: 100rpx;
  248. font-size: 30rpx;
  249. }
  250. }
  251. .bottomTab {
  252. display: flex;
  253. justify-content: space-between;
  254. height: 10vh;
  255. padding: 0 80rpx;
  256. margin-top: 30rpx;
  257. .tabbarItemActive {
  258. color: $uni-color;
  259. }
  260. .tabbarItemNoActive {
  261. color: #9c9fa4;
  262. }
  263. }
  264. .forgetPassword {
  265. padding: 100rpx 40rpx 0 40rpx;
  266. .title {
  267. display: flex;
  268. justify-content: center;
  269. align-items: flex-end;
  270. height: 10vh;
  271. color: #000;
  272. font-size: 40rpx;
  273. font-weight: 700;
  274. }
  275. .form1 {
  276. display: flex;
  277. flex-direction: column;
  278. gap: 30rpx;
  279. margin-top: 20rpx;
  280. padding: 20rpx 80rpx;
  281. .userName {
  282. // padding: 20rpx 100 rpx;
  283. }
  284. .code {
  285. display: flex;
  286. width: 100%;
  287. .left {
  288. width: 55%;
  289. }
  290. .right {
  291. width: 45%;
  292. height: 100%;
  293. >view:nth-of-type(1) {
  294. display: flex;
  295. justify-content: center;
  296. align-items: center;
  297. width: 100%;
  298. }
  299. }
  300. }
  301. .password1 {}
  302. .password2 {}
  303. }
  304. }
  305. }
  306. }
  307. </style>