作者 燕成杰

注册、登录、忘记密码、我的、首页部分 意见、问题接口

@@ -3,6 +3,12 @@ import { @@ -3,6 +3,12 @@ import {
3 } from '@/utils/request.js' 3 } from '@/utils/request.js'
4 4
5 5
6 -// xxx  
7 -export const getDetail = () => request({url: '/gift/gift/list',method: 'post',data: {}}) 6 +// 轮播图 /api/index/banner
  7 +export const getBanner = () => request({url: 'index/banner',method: 'post',data: {}})
  8 +
  9 +// 首页分类 /api/index/sort_index
  10 +export const sortList = () => request({url: 'index/sort_index',method: 'post',data: {}})
  11 +
  12 +// 首页相关资讯列表 /api/index/arc_list
  13 +export const arcList = () => request({url: 'index/arc_list',method: 'post',data: {}})
8 14
  1 +import {
  2 + request
  3 +} from '@/utils/request.js'
  4 +
  5 +
  6 +// 会员登录 /api/user/login
  7 +export const login = (account,password) => request({url: 'user/login',method: 'post',data: {account,password}})
  8 +
  9 +// 注册会员 /api/user/register
  10 +export const register = (username,password,mobile,code) => request({url: 'user/register',method: 'post',data: {username,password,mobile,code}})
  11 +
  12 +// 发送验证码 /api/sms/send
  13 +export const sendCode = (mobile,event) => request({url: 'sms/send',method: 'post',data: {mobile,event}})
  14 +
  15 +// 重置密码 /api/user/resetpwd
  16 +export const resetPassword = (mobile,captcha,newpassword,confirmpassword) => request({url: 'user/resetpwd',method: 'post',data: {mobile,captcha,newpassword,confirmpassword}})
  17 +
  18 +// 用户、隐私协议 /api/common/agreement type integer 是 类型:1=用户协议2=隐私协议
  19 +export const getAgreement = (type) => request({url: 'common/agreement ',method: 'post',data: {type}})
  1 +import {
  2 + request
  3 +} from '@/utils/request.js'
  4 +
  5 + // 会员中心 /api/user/index
  6 +export const getUserInfo = () => request({url: 'user/index',method: 'post',data: {}})
  7 +
  8 +// 退出登录 /api/user/logout
  9 +export const logotLogin = () => request({url: 'user/logout',method: 'post',data: {}})
  10 +
  11 +// 联系客服、品牌入驻 /api/common/contact
  12 +export const getContactQrcode = (type) => request({url: 'common/contact',method: 'post',data: {type}})
  13 +
  14 +// 常见问题分类 /api/common/problem_sort
  15 +export const problemSort = () => request({url: 'common/problem_sort',method: 'post',data: {}})
  16 +
  17 +// 常见问题列表 /api/common/problem_list
  18 +export const problemList = (sort_id,page,pagenum) => request({url: 'common/problem_list',method: 'post',data: {sort_id,page,pagenum}})
  19 +
  20 +// 常见问题详情 /api/common/problem_detail
  21 +export const problemDetail = (problem_id) => request({url: 'common/problem_detail',method: 'post',data: {problem_id}})
  22 +
  23 +// 意见反馈 /api/user/feedback
  24 +export const doFeedback = (content,image) => request({url: 'user/feedback',method: 'post',data: {content,image}})
@@ -151,7 +151,7 @@ @@ -151,7 +151,7 @@
151 "path" : "pages/login/login", 151 "path" : "pages/login/login",
152 "style" : 152 "style" :
153 { 153 {
154 - "navigationBarTitleText": "", 154 + "navigationBarTitleText": "登录",
155 "enablePullDownRefresh": false 155 "enablePullDownRefresh": false
156 } 156 }
157 157
@@ -160,7 +160,7 @@ @@ -160,7 +160,7 @@
160 "path" : "pages/login/register", 160 "path" : "pages/login/register",
161 "style" : 161 "style" :
162 { 162 {
163 - "navigationBarTitleText": "", 163 + "navigationBarTitleText": "注册",
164 "enablePullDownRefresh": false 164 "enablePullDownRefresh": false
165 } 165 }
166 166
@@ -169,7 +169,15 @@ @@ -169,7 +169,15 @@
169 "path" : "pages/login/password", 169 "path" : "pages/login/password",
170 "style" : 170 "style" :
171 { 171 {
172 - "navigationBarTitleText": "", 172 + "navigationBarTitleText": "忘记密码",
  173 + "enablePullDownRefresh": false
  174 + }
  175 +
  176 + },{
  177 + "path" : "pages/login/agreement",
  178 + "style" :
  179 + {
  180 + "navigationBarTitleText": "用户协议",
173 "enablePullDownRefresh": false 181 "enablePullDownRefresh": false
174 } 182 }
175 183
@@ -2,29 +2,29 @@ @@ -2,29 +2,29 @@
2 <view class="content"> 2 <view class="content">
3 <view class="top"> 3 <view class="top">
4 <view class="logo"> 4 <view class="logo">
5 - <image src="../../static/logo.png" mode=""></image> 5 + <image src="/static/ic_logo.png" mode=""></image>
6 <view class="search"> 6 <view class="search">
7 <view class="tosear" @click="gosourch"> 7 <view class="tosear" @click="gosourch">
8 <input type="text" value="" placeholder="搜索" disabled="true" 8 <input type="text" value="" placeholder="搜索" disabled="true"
9 placeholder-style="text-align: center;font-size: 28rpx; color: rgba(194,194,194,1);" /> 9 placeholder-style="text-align: center;font-size: 28rpx; color: rgba(194,194,194,1);" />
10 - <image src="../../static/icon-search.png" mode=""></image> 10 + <image src="/static/icon-search.png" mode=""></image>
11 </view> 11 </view>
12 </view> 12 </view>
13 </view> 13 </view>
14 <view class="banner"> 14 <view class="banner">
15 - <u-swiper :list="list1" @click="click" :indicator="true" indicatorMode="dot" radius="12" height="160" 15 + <u-swiper keyName="image_preview" :list="list1" @click="click" :indicator="true" indicatorMode="dot" radius="12" height="160"
16 :circular="true"> 16 :circular="true">
17 </u-swiper> 17 </u-swiper>
18 </view> 18 </view>
19 </view> 19 </view>
20 <view class="contail"> 20 <view class="contail">
21 <view class="nev"> 21 <view class="nev">
22 - <view class="bar" v-for="(item,index) in nevlist" :key="index">  
23 - <image class="barimg" src="../../static/logo.png" mode=""></image>  
24 - <text>第十四大</text> 22 + <view class="bar" v-for="(item,index) in categoryList" :key="index">
  23 + <image class="barimg" :src="item.image_preview" mode=""></image>
  24 + <text>{{item.name}}</text>
25 </view> 25 </view>
26 - <view class="bar">  
27 - <image class="barimg" src="../../static/logo.png" mode=""></image> 26 + <view class="bar" v-if="categoryLength>8">
  27 + <image class="barimg" src="/static/logo.png" mode=""></image>
28 <text>更多</text> 28 <text>更多</text>
29 </view> 29 </view>
30 </view> 30 </view>
@@ -36,11 +36,11 @@ @@ -36,11 +36,11 @@
36 </view> 36 </view>
37 <view class="more"> 37 <view class="more">
38 更多 38 更多
39 - <image src="../../static/ic-arrow.png" mode=""></image> 39 + <image src="/static/ic-arrow.png" mode=""></image>
40 </view> 40 </view>
41 </view> 41 </view>
42 <view class="newbar"> 42 <view class="newbar">
43 - <view v-for="(item,index) in leftlist" :key="index">·比特币明日走势图</view> 43 + <view v-for="(item,index) in informationList" :key="index">·{{item.title}}</view>
44 </view> 44 </view>
45 </view> 45 </view>
46 <view class="rightbox"> 46 <view class="rightbox">
@@ -53,9 +53,9 @@ @@ -53,9 +53,9 @@
53 </view> 53 </view>
54 </view> 54 </view>
55 <view class="activeimg"> 55 <view class="activeimg">
56 - <image src="../../static/Rectangle 2372.png" mode=""></image>  
57 - <!-- <image src="../../static/logo.png" mode=""></image>  
58 - <image src="../../static/logo.png" mode=""></image> --> 56 + <image src="/static/Rectangle 2372.png" mode=""></image>
  57 + <!-- <image src="/static/logo.png" mode=""></image>
  58 + <image src="/static/logo.png" mode=""></image> -->
59 </view> 59 </view>
60 </view> 60 </view>
61 </view> 61 </view>
@@ -115,6 +115,7 @@ @@ -115,6 +115,7 @@
115 </template> 115 </template>
116 116
117 <script> 117 <script>
  118 + import { getBanner, sortList,arcList} from '@/api/index'
118 import helangWaterfall from "@/uni_modules/custom-waterfalls-flow/components/custom-waterfalls-flow/custom-waterfalls-flow.vue" 119 import helangWaterfall from "@/uni_modules/custom-waterfalls-flow/components/custom-waterfalls-flow/custom-waterfalls-flow.vue"
119 import Botton from "@/components/Botton.vue" 120 import Botton from "@/components/Botton.vue"
120 export default { 121 export default {
@@ -158,13 +159,41 @@ @@ -158,13 +159,41 @@
158 title: '我是标题2', 159 title: '我是标题2',
159 desc: '描述描述描述描述描述描述描述描述2' 160 desc: '描述描述描述描述描述描述描述描述2'
160 } 161 }
161 - ] 162 + ],
  163 + categoryList:[], // 分类列表
  164 + categoryLength:0 ,//分类数量
  165 + informationList:[] // 相关资讯
162 } 166 }
163 }, 167 },
  168 + onShow() {
  169 + this.initial()
  170 + },
164 onLoad() { 171 onLoad() {
165 172
166 }, 173 },
167 methods: { 174 methods: {
  175 + async initial(){
  176 + try {
  177 + // 轮播图
  178 + const res = await getBanner()
  179 + // 分类
  180 + const sortRes = await sortList()
  181 + // 相关资讯
  182 + const information= await arcList()
  183 + // 轮播图
  184 + this.list1 =res.list
  185 + this.categoryLength = sortRes.list.length
  186 + this.categoryList = sortRes.list.length>8?sortRes.list.slice(0,7):sortRes.list
  187 + this.informationList = information.list.length>3?information.list.slice(0,3):information.list
  188 + console.log(sortRes,'分类');
  189 + console.log('getBanner', res)
  190 + console.log(information,'资讯列表');
  191 + // 保存数据
  192 + } catch (err) {
  193 + uni.showToast({ title:err,icon:'none' })
  194 + console.log('getBanner', err)
  195 + }
  196 + },
168 changefall(e) { 197 changefall(e) {
169 this.fallindex = e 198 this.fallindex = e
170 }, 199 },
@@ -195,8 +224,8 @@ @@ -195,8 +224,8 @@
195 align-items: center; 224 align-items: center;
196 225
197 image { 226 image {
198 - width: 98rpx;  
199 - height: 50rpx; 227 + width: 84rpx;
  228 + height: 74rpx;
200 margin-right: 36rpx; 229 margin-right: 36rpx;
201 } 230 }
202 231
  1 +<template>
  2 + <view class="">
  3 + <rich-text :nodes="text"></rich-text>
  4 + </view>
  5 +</template>
  6 +
  7 +<script>
  8 + import { getAgreement } from '@/api/login.js'
  9 + export default {
  10 + data() {
  11 + return {
  12 + text: '',
  13 + type:''
  14 + }
  15 + },
  16 + onLoad(e) {
  17 + this.type = e.type
  18 + this.getAgreement()
  19 + },
  20 + methods: {
  21 + async getAgreement(){
  22 + try {
  23 + const res = await getAgreement(this.type)
  24 + this.text = res.agreement
  25 + console.log('getAgreement', res)
  26 + // 保存数据
  27 + } catch (err) {
  28 + uni.showToast({ title:err,icon:'none' })
  29 + console.log('getAgreement', err)
  30 + }
  31 + },
  32 + },
  33 + }
  34 +</script>
  35 +
  36 +<style>
  37 +</style>
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 用户名: 8 用户名:
9 </view> 9 </view>
10 <view class="last name"> 10 <view class="last name">
11 - <input type="text" value="" placeholder="请输入用户名" /> 11 + <input v-model="account" maxlength="16" type="text" value="" placeholder="请输入用户名" />
12 </view> 12 </view>
13 </view> 13 </view>
14 <view class="bar flexwrap"> 14 <view class="bar flexwrap">
@@ -16,27 +16,66 @@ @@ -16,27 +16,66 @@
16 密码: 16 密码:
17 </view> 17 </view>
18 <view class="last name"> 18 <view class="last name">
19 - <input type="text" value="" placeholder="密码:" /> 19 + <input v-model="password" maxlength="16" type="text" value="" placeholder="密码:" />
20 </view> 20 </view>
21 </view> 21 </view>
22 - <view class="loginbtn"> 22 + <view class="loginbtn" @click="doLogin">
23 登录 23 登录
24 </view> 24 </view>
25 <view class="passway"> 25 <view class="passway">
26 - <text>忘记密码</text>  
27 - <text>没有账号,去注册</text> 26 + <text @click="forget">忘记密码</text>
  27 + <text @click="register">没有账号,去注册</text>
28 </view> 28 </view>
29 </view> 29 </view>
30 </view> 30 </view>
31 </template> 31 </template>
32 32
33 <script> 33 <script>
  34 + import { login } from '@/api/login.js'
  35 + import {toa } from '@/utils/toast.js'
34 export default { 36 export default {
35 data() { 37 data() {
36 return { 38 return {
37 - 39 + account:'',
  40 + password:''
38 }; 41 };
  42 + },
  43 + methods: {
  44 + forget() {
  45 + uni.navigateTo({
  46 + url:'/pages/login/password'
  47 + })
  48 + },
  49 + register(){
  50 + uni.navigateTo({
  51 + url:'/pages/login/register'
  52 + })
  53 + },
  54 + // 登录
  55 + doLogin(){
  56 + if(!this.account) return toa.toast('请输入账号')
  57 + if(!this.password) return toa.toast('请输入密码')
  58 + this.login()
  59 + },
  60 + async login(){
  61 + try {
  62 + const res = await login(this.account,this.password)
  63 + console.log('login', res)
  64 + uni.setStorageSync('userInfo',res.userinfo)
  65 + uni.setStorageSync('token',res.userinfo.token)
  66 + setTimeout(()=>{
  67 + toa.success('登录成功')
  68 + },200)
  69 + uni.reLaunch({
  70 + url:'/pages/index/index'
  71 + })
  72 + // 保存数据
  73 + } catch (err) {
  74 + uni.showToast({ title:err,icon:'none' })
  75 + console.log('login', err)
39 } 76 }
  77 + },
  78 + },
40 } 79 }
41 </script> 80 </script>
42 81
@@ -67,8 +106,9 @@ @@ -67,8 +106,9 @@
67 width: 180rpx; 106 width: 180rpx;
68 } 107 }
69 108
70 - .lastname {  
71 - width: 300rpx; 109 + .last {
  110 + flex: 1;
  111 + // width: 300rpx;
72 } 112 }
73 } 113 }
74 114
@@ -6,10 +6,10 @@ @@ -6,10 +6,10 @@
6 </view> 6 </view>
7 <view class="bar flexwrap"> 7 <view class="bar flexwrap">
8 <view class="name"> 8 <view class="name">
9 - 用户名 9 + 手机号
10 </view> 10 </view>
11 <view class="lastname"> 11 <view class="lastname">
12 - <input type="text" value="" placeholder="请输入用户名" /> 12 + <input v-model="mobile" maxlength="16" type="text" value="" placeholder="请输入手机号" />
13 </view> 13 </view>
14 </view> 14 </view>
15 <view class="bar flexwrap"> 15 <view class="bar flexwrap">
@@ -17,9 +17,9 @@ @@ -17,9 +17,9 @@
17 验证码: 17 验证码:
18 </view> 18 </view>
19 <view class="lastname"> 19 <view class="lastname">
20 - <input type="text" value="" placeholder="请输入验证码" />  
21 - <view class="code">  
22 - 获取验证码 20 + <input v-model="captcha" maxlength="" type="number" value="" placeholder="请输入验证码" />
  21 + <view class="code" @click="getCode">
  22 + {{num==0?'获取验证码':num + '秒重新发送'}}
23 </view> 23 </view>
24 </view> 24 </view>
25 </view> 25 </view>
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 密码: 28 密码:
29 </view> 29 </view>
30 <view class="lastname"> 30 <view class="lastname">
31 - <input type="text" value="" placeholder="请输入密码" /> 31 + <input v-model="newpassword" type="text" value="" placeholder="请输入密码" />
32 </view> 32 </view>
33 </view> 33 </view>
34 <view class="bar flexwrap"> 34 <view class="bar flexwrap">
@@ -36,10 +36,10 @@ @@ -36,10 +36,10 @@
36 确认密码: 36 确认密码:
37 </view> 37 </view>
38 <view class="lastname"> 38 <view class="lastname">
39 - <input type="text" value="" placeholder="请确认密码" /> 39 + <input v-model="confirmpassword" type="text" value="" placeholder="请确认密码" />
40 </view> 40 </view>
41 </view> 41 </view>
42 - <view class="loginbtn"> 42 + <view class="loginbtn" @click="goReset">
43 确认 43 确认
44 </view> 44 </view>
45 </view> 45 </view>
@@ -47,12 +47,66 @@ @@ -47,12 +47,66 @@
47 </template> 47 </template>
48 48
49 <script> 49 <script>
  50 + import {sendCode,resetPassword} from '@/api/login.js'
  51 + import {toa} from '@/utils/toast.js'
50 export default { 52 export default {
51 data() { 53 data() {
52 return { 54 return {
53 - 55 + mobile:'',
  56 + captcha:'',
  57 + newpassword:'',
  58 + confirmpassword:'',
  59 + clearId:'',
  60 + num:0,
54 }; 61 };
  62 + },
  63 + methods: {
  64 + getCode(){
  65 + if(this.num>0) return
  66 + if(!this.mobile) return toa.toast('请先输入手机号')
  67 + if (!(/^1[34578]\d{9}$/.test(this.mobile))) return toa.toast('请输入正确手机号')
  68 + this.sendCode()
  69 + },
  70 + async sendCode(){
  71 + try {
  72 + const res = await sendCode(this.mobile,'resetpwd')
  73 + toa.success('发送成功')
  74 + this.setInter()
  75 + console.log('sendCode', res)
  76 + // 保存数据
  77 + } catch (err) {
  78 + uni.showToast({ title:err,icon:'none' })
  79 + console.log('sendCode', err)
  80 + }
  81 + },
  82 + setInter (){
  83 + this.num=60
  84 + this.clearId = setInterval(() => {
  85 + this.num --
  86 + }, 1000)
  87 + },
  88 + goReset(){
  89 + if(!this.mobile) return toa.toast('请输入手机号')
  90 + if(!this.captcha) return toa.toast('请输入验证码')
  91 + if(!this.newpassword) return toa.toast('请输入密码')
  92 + if(!this.confirmpassword) return toa.toast('请输入确认密码')
  93 + this.resetPassword()
  94 + },
  95 + async resetPassword(){
  96 + try {
  97 + const res = await resetPassword(this.mobile,this.captcha,this.newpassword,this.confirmpassword)
  98 + console.log('resetPassword', res)
  99 + setTimeout(()=>{
  100 + toa.success('重置密码成功')
  101 + },200)
  102 + uni.navigateBack({})
  103 + // 保存数据
  104 + } catch (err) {
  105 + uni.showToast({ title:err,icon:'none' })
  106 + console.log('resetPassword', err)
55 } 107 }
  108 + },
  109 + },
56 } 110 }
57 </script> 111 </script>
58 112
@@ -89,7 +143,8 @@ @@ -89,7 +143,8 @@
89 position: relative; 143 position: relative;
90 144
91 input { 145 input {
92 - width: 260rpx; 146 + width: 100%;
  147 + // width: 260rpx;
93 } 148 }
94 149
95 .code { 150 .code {
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 用户名: 8 用户名:
9 </view> 9 </view>
10 <view class="lastname"> 10 <view class="lastname">
11 - <input type="text" value="" placeholder="请输入用户名" /> 11 + <input v-model="username" maxlength="16" type="text" value="" placeholder="请输入用户名" />
12 </view> 12 </view>
13 </view> 13 </view>
14 <view class="bar flexwrap"> 14 <view class="bar flexwrap">
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 密码: 16 密码:
17 </view> 17 </view>
18 <view class="lastname"> 18 <view class="lastname">
19 - <input type="text" value="" placeholder="请输入密码" /> 19 + <input v-model="password" maxlength="16" type="text" value="" placeholder="请输入密码" />
20 </view> 20 </view>
21 </view> 21 </view>
22 <view class="bar flexwrap"> 22 <view class="bar flexwrap">
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 手机号: 24 手机号:
25 </view> 25 </view>
26 <view class="lastname"> 26 <view class="lastname">
27 - <input type="text" value="" placeholder="请输入手机号" /> 27 + <input v-model="mobile" maxlength="11" type="number" value="" placeholder="请输入手机号" />
28 </view> 28 </view>
29 </view> 29 </view>
30 <view class="bar flexwrap"> 30 <view class="bar flexwrap">
@@ -32,35 +32,112 @@ @@ -32,35 +32,112 @@
32 验证码: 32 验证码:
33 </view> 33 </view>
34 <view class="lastname"> 34 <view class="lastname">
35 - <input type="text" value="" placeholder="请输入验证码" />  
36 - <view class="code">  
37 - 获取验证码 35 + <input v-model="code" maxlength="6" type="text" value="" placeholder="请输入验证码" />
  36 + <view class="code" @click="getCode">
  37 + {{num==0?'获取验证码':num + '秒重新发送'}}
38 </view> 38 </view>
39 </view> 39 </view>
40 </view> 40 </view>
41 - <view class="loginbtn"> 41 + <view class="loginbtn" @click="toRegister">
42 注册 42 注册
43 </view> 43 </view>
44 - <view class="passway"> 44 + <view class="passway" @click="goLogin">
45 <text>已有账号,直接登录</text> 45 <text>已有账号,直接登录</text>
46 </view> 46 </view>
47 <view class="user"> 47 <view class="user">
48 - <image src="../../static/icon24.png" mode=""></image>  
49 - <image src="../../static/icon25.png" mode=""></image> 48 + <image v-if="isSelect" @click="isSelect=!isSelect" src="/static/icon25.png" mode=""></image>
  49 + <image v-else @click="isSelect=!isSelect" src="/static/icon24.png" mode=""></image>
50 我已阅读并同意 50 我已阅读并同意
51 - <text>用户协议、</text><text>隐私政策</text> 51 + <text style="margin-left: 10rpx;" @click="toAgree(1)"> 用户协议、</text><text @click="toAgree(2)">隐私政策</text>
52 </view> 52 </view>
53 </view> 53 </view>
  54 +
54 </view> 55 </view>
55 </template> 56 </template>
56 57
57 <script> 58 <script>
  59 + import {sendCode,register} from '@/api/login.js'
  60 + import {toa} from '@/utils/toast.js'
58 export default { 61 export default {
59 data() { 62 data() {
60 return { 63 return {
61 - 64 + username:'',
  65 + password:'',
  66 + mobile:'',
  67 + code:'',
  68 + clearId:'',
  69 + num:0,
  70 + isSelect:false
62 }; 71 };
63 - } 72 + },
  73 + methods: {
  74 + goLogin() {
  75 + uni.navigateBack({})
  76 + // uni.navigateTo({
  77 + // url:'/pages/login/login'
  78 + // })
  79 + },
  80 + toRegister(){
  81 + if(!this.username) return toa.toast('请输入用户名')
  82 + if(!this.password) return toa.toast('请输入密码')
  83 + if(!this.mobile) return toa.toast('请输入手机号')
  84 + if(!this.code) return toa.toast('请输入验证码')
  85 + if(!this.isSelect) return toa.toast('请先同意用户协议和隐私政策')
  86 + this.register()
  87 + },
  88 + async register(){
  89 + try {
  90 + const res = await register(this.username,this.password,this.mobile,this.code)
  91 + console.log('register', res)
  92 + toa.success('注册成功')
  93 + // 保存数据
  94 + } catch (err) {
  95 + uni.showToast({ title:err,icon:'none' })
  96 + console.log('register', err)
  97 + }
  98 + },
  99 + getCode(){
  100 + if(this.num>0) return
  101 + if(!this.mobile) return toa.toast('请先输入手机号')
  102 + if (!(/^1[34578]\d{9}$/.test(this.mobile))) return toa.toast('请输入正确手机号')
  103 + this.sendCode()
  104 + },
  105 + async sendCode(){
  106 + try {
  107 + const res = await sendCode(this.mobile,'register')
  108 + toa.success('发送成功')
  109 + this.setInter()
  110 + console.log('sendCode', res)
  111 + // 保存数据
  112 + } catch (err) {
  113 + uni.showToast({ title:err,icon:'none' })
  114 + console.log('sendCode', err)
  115 + }
  116 + },
  117 + setInter (){
  118 + this.num=60
  119 + this.clearId = setInterval(() => {
  120 + this.num --
  121 + }, 1000)
  122 + },
  123 + toAgree(type){
  124 + uni.navigateTo({
  125 + url:'/pages/login/agreement?type='+ type
  126 + })
  127 + }
  128 + },
  129 + onHide(){
  130 + this.num = 0
  131 + clearInterval(this.clearId)
  132 + },
  133 + watch: {
  134 + num(newValue, oldValue) {
  135 + if(newValue==0){
  136 + this.num = 0
  137 + clearInterval(this.clearId)
  138 + }
  139 + }
  140 + },
64 } 141 }
65 </script> 142 </script>
66 143
@@ -96,7 +173,8 @@ @@ -96,7 +173,8 @@
96 position: relative; 173 position: relative;
97 174
98 input { 175 input {
99 - width: 260rpx; 176 + // width: 260rpx;
  177 + width: 100%;
100 } 178 }
101 179
102 .code { 180 .code {
@@ -140,7 +218,7 @@ @@ -140,7 +218,7 @@
140 218
141 .user { 219 .user {
142 position: fixed; 220 position: fixed;
143 - bottom: 28rpx; 221 + bottom: 78rpx;
144 left: 50%; 222 left: 50%;
145 width: 100%; 223 width: 100%;
146 text-align: center; 224 text-align: center;
@@ -4,16 +4,23 @@ @@ -4,16 +4,23 @@
4 <view class="title"> 4 <view class="title">
5 建议&意见 5 建议&意见
6 </view> 6 </view>
7 - <u--textarea :autoHeight="true" maxlength="300" v-model="value1" border="none" placeholder="请输入内容" ></u--textarea>  
8 - <view class="title"> 7 + <u--textarea :autoHeight="true" maxlength="300" v-model="content" border="none" placeholder="请输入内容">
  8 + </u--textarea>
  9 + <view class="title" style="margin-top: 24rpx;">
9 上传图片(选填) 10 上传图片(选填)
10 </view> 11 </view>
11 <view class="botImage"> 12 <view class="botImage">
  13 + <view class="box" v-for="(item,idx) in imgList" :key="idx">
  14 + <image @click="delImage(idx)" class="close" src="/static/closeImage.png" mode=""></image>
  15 + <image class="image" :src="item.fullurl" mode=""></image>
  16 + </view>
  17 + <view class="box" v-if="imgList.length<9" @click="upload">
12 <image src="/static/addPhoto.png" mode=""></image> 18 <image src="/static/addPhoto.png" mode=""></image>
13 </view> 19 </view>
14 </view> 20 </view>
  21 + </view>
15 <view class="botBtn flexC"> 22 <view class="botBtn flexC">
16 - <view class="flexC"> 23 + <view class="flexC" @click="submit">
17 提交 24 提交
18 </view> 25 </view>
19 </view> 26 </view>
@@ -21,11 +28,70 @@ @@ -21,11 +28,70 @@
21 </template> 28 </template>
22 29
23 <script> 30 <script>
  31 + var that
  32 + import {
  33 + doFeedback
  34 + } from '@/api/mine.js'
  35 + import { toa } from '@/utils/toast.js'
  36 + import {
  37 + uploadFile
  38 + } from '@/utils/upload.js'
24 export default { 39 export default {
25 data() { 40 data() {
26 return { 41 return {
27 - value1: '' 42 + content: '',
  43 + image:'',
  44 + imgList: []
  45 + }
  46 + },
  47 + onLoad() {
  48 + that = this
  49 + },
  50 + methods: {
  51 + // 删除图片
  52 + delImage(idx){
  53 + this.imgList.splice(idx,1)
  54 + },
  55 +
  56 + upload() {
  57 + uni.chooseImage({
  58 + count: 9 - that.imgList.length, //默认9
  59 + sizeType: ['original'], //可以指定是原图还是压缩图,默认二者都有 , 'original','compressed'
  60 + sourceType: ['album'], //从相册选择
  61 + success: async function(res) {
  62 + console.log(JSON.stringify(res.tempFilePaths));
  63 + const tempFilePaths = res.tempFilePaths;
  64 + for (let i = 0; i < tempFilePaths.length; i++) {
  65 + const result = await uploadFile(tempFilePaths[i])
  66 + console.log(result);
  67 + that.imgList.push(result)
  68 + }
28 } 69 }
  70 + });
  71 + },
  72 + submit(){
  73 + if(!this.content) return toa.toast('请输入意见或反馈内容')
  74 + // if(!this.imgList.length) return toa.toast('请上传图片')
  75 + this.image = this.imgList.map(it=>it.url)
  76 + this.Feedback()
  77 + },
  78 + async Feedback() {
  79 + try {
  80 + const res = await doFeedback(this.content,this.image)
  81 + console.log('doFeedback', res)
  82 + setTimeout(()=>{
  83 + toa.success('反馈成功')
  84 + },200)
  85 + uni.navigateBack({})
  86 + // 保存数据
  87 + } catch (err) {
  88 + uni.showToast({
  89 + title: err,
  90 + icon: 'none'
  91 + })
  92 + console.log('doFeedback', err)
  93 + }
  94 + },
29 }, 95 },
30 } 96 }
31 </script> 97 </script>
@@ -34,24 +100,46 @@ @@ -34,24 +100,46 @@
34 page { 100 page {
35 background: #f6f6f6; 101 background: #f6f6f6;
36 } 102 }
37 - .mainBox{ 103 +
  104 + .mainBox {
38 padding: 54rpx 30rpx; 105 padding: 54rpx 30rpx;
  106 +
39 .title { 107 .title {
40 margin-bottom: 24rpx; 108 margin-bottom: 24rpx;
41 - color: rgba(0,0,0,0.9); 109 + color: rgba(0, 0, 0, 0.9);
42 font-size: 36rpx; 110 font-size: 36rpx;
43 font-weight: 700; 111 font-weight: 700;
44 } 112 }
45 } 113 }
  114 +
46 .u-textarea { 115 .u-textarea {
47 min-height: 292rpx; 116 min-height: 292rpx;
48 } 117 }
  118 +
49 .botImage { 119 .botImage {
  120 + display: flex;
  121 + flex-wrap: wrap;
  122 + .box {
  123 + position: relative;
  124 + margin-right: 30rpx;
  125 + margin-bottom: 20rpx;
  126 + }
  127 + .box:nth-child(3n) {
  128 + margin-right: 0;
  129 + }
50 image { 130 image {
51 width: 200rpx; 131 width: 200rpx;
52 height: 200rpx; 132 height: 200rpx;
53 } 133 }
  134 + .close {
  135 + width: 36rpx;
  136 + height: 36rpx;
  137 + position: absolute;
  138 + right: 0;
  139 + top: 0;
  140 + }
54 } 141 }
  142 +
55 .botBtn { 143 .botBtn {
56 position: fixed; 144 position: fixed;
57 left: 0; 145 left: 0;
@@ -59,16 +147,20 @@ @@ -59,16 +147,20 @@
59 width: 750rpx; 147 width: 750rpx;
60 height: 128rpx; 148 height: 128rpx;
61 opacity: 1; 149 opacity: 1;
62 - background: rgba(255,255,255,1); 150 + background: rgba(255, 255, 255, 1);
  151 +
63 view { 152 view {
64 width: 686rpx; 153 width: 686rpx;
65 height: 96rpx; 154 height: 96rpx;
66 - color: rgba(0,0,0,0.9); 155 + color: rgba(0, 0, 0, 0.9);
67 font-size: 32rpx; 156 font-size: 32rpx;
68 font-weight: 500; 157 font-weight: 500;
69 border-radius: 28rpx; 158 border-radius: 28rpx;
70 opacity: 1; 159 opacity: 1;
71 - background: linear-gradient(134.8deg, rgba(255,232,100,1) 0%, rgba(255,216,0,1) 100%); 160 + background: linear-gradient(134.8deg, rgba(255, 232, 100, 1) 0%, rgba(255, 216, 0, 1) 100%);
  161 + }
72 } 162 }
  163 + /deep/ .uni-textarea-wrapper {
  164 + height: 100% !important;
73 } 165 }
74 </style> 166 </style>
@@ -3,11 +3,11 @@ @@ -3,11 +3,11 @@
3 <view class="top"><image class="wh100" src="/static/questionBg.png" mode=""></image></view> 3 <view class="top"><image class="wh100" src="/static/questionBg.png" mode=""></image></view>
4 <view class="topTitle">有什么可以帮您!</view> 4 <view class="topTitle">有什么可以帮您!</view>
5 <view class="botQuestion"> 5 <view class="botQuestion">
6 - <u-tabs :list="list2" lineColor="#FED000" :scrollable="false" @click="click"></u-tabs>  
7 - <scroll-view scroll-y="true" class="questionList">  
8 - <view class="list" v-for="(item,idx) in 50" :key="idx" @click="toItem">  
9 - <view class="question">123132</view>  
10 - <view class="arrow"><image class="wh100" src="/static/arrowR.png" mode=""></image></view> 6 + <u-tabs :list="list2" lineColor="#FED000" :scrollable="false" @click="toggle"></u-tabs>
  7 + <scroll-view scroll-y="true" class="questionList" @scrolltolower="scrolltolower">
  8 + <view class="list" v-for="(item,idx) in list" :key="idx" @click="toItem(item.id)">
  9 + <view class="question">{{item.title}}</view>
  10 + <view class="arrow"><image src="/static/arrowR.png" ></image></view>
11 </view> 11 </view>
12 </scroll-view> 12 </scroll-view>
13 </view> 13 </view>
@@ -15,6 +15,8 @@ @@ -15,6 +15,8 @@
15 </template> 15 </template>
16 16
17 <script> 17 <script>
  18 + import {toa} from '@/utils/toast.js'
  19 + import { problemSort,problemList } from '@/api/mine.js'
18 export default { 20 export default {
19 data() { 21 data() {
20 return { 22 return {
@@ -25,13 +27,59 @@ @@ -25,13 +27,59 @@
25 }, { 27 }, {
26 name: '服务条款' 28 name: '服务条款'
27 },{name:'分期支付'}], 29 },{name:'分期支付'}],
  30 + page:1,
  31 + lastPage:1,
  32 + curId:'',
  33 + list:[]
28 } 34 }
29 }, 35 },
  36 + onLoad() {
  37 + this.problemSort()
  38 + },
30 methods: { 39 methods: {
31 - toItem() { 40 + toItem(id) {
32 uni.navigateTo({ 41 uni.navigateTo({
33 - url:'/pages/mine/questionDetails' 42 + url:'/pages/mine/questionDetails?id='+id
34 }) 43 })
  44 + },
  45 + async problemSort(){
  46 + try {
  47 + const res = await problemSort()
  48 + this.list2 = res.list
  49 + this.curId = res.list[0].id
  50 + this.problemList()
  51 + console.log('problemSort', res)
  52 + // 保存数据
  53 + } catch (err) {
  54 + uni.showToast({ title:err,icon:'none' })
  55 + console.log('problemSort', err)
  56 + }
  57 + },
  58 + async problemList(f){
  59 + try {
  60 + toa.loading('加载中')
  61 + const res = await problemList(this.curId,this.page,15)
  62 + toa.hideLoading()
  63 + this.lastPage = res.list.last_page
  64 + this.list = f?res.list.data:this.list.concat(res.list.data)
  65 + console.log('problemList', res)
  66 + // 保存数据
  67 + } catch (err) {
  68 + uni.showToast({ title:err,icon:'none' })
  69 + console.log('problemList', err)
  70 + }
  71 + },
  72 + toggle(e){
  73 + console.log(e);
  74 + if(this.curId == e.id) return
  75 + this.page = 1
  76 + this.curId = e.id
  77 + this.problemList(1)
  78 + },
  79 + scrolltolower(){
  80 + if(this.page >= this.lastPage) return
  81 + this.page=this.page+1
  82 + this.problemList()
35 } 83 }
36 }, 84 },
37 } 85 }
@@ -72,10 +120,15 @@ @@ -72,10 +120,15 @@
72 display: flex; 120 display: flex;
73 justify-content: space-between; 121 justify-content: space-between;
74 align-items: center; 122 align-items: center;
75 - height: 40rpx; 123 + // height: 40rpx;
76 .arrow { 124 .arrow {
  125 + margin-left: 10rpx;
77 width: 16rpx; 126 width: 16rpx;
78 height: 32rpx; 127 height: 32rpx;
  128 + image {
  129 + width: 16rpx;
  130 + height: 32rpx;
  131 + }
79 } 132 }
80 } 133 }
81 } 134 }
@@ -2,25 +2,25 @@ @@ -2,25 +2,25 @@
2 <view class=""> 2 <view class="">
3 <view class="absTop"></view> 3 <view class="absTop"></view>
4 <view class="mainBox"> 4 <view class="mainBox">
5 - <view class="exit flexA"> 5 + <view class="exit flexA" :style="token?'visibility: visible':'visibility: hidden'" @click="showCancel = true">
6 <image src="/static/exit.png" mode=""></image> 6 <image src="/static/exit.png" mode=""></image>
7 退出登录 7 退出登录
8 </view> 8 </view>
9 <view class="topInfo flexA"> 9 <view class="topInfo flexA">
10 - <image src="/static/logo.png" mode=""></image> 10 + <image :src="userInfo.avatar" mode=""></image>
11 <view class="right"> 11 <view class="right">
12 - <view class="">张小萌</view>  
13 - <view class="">15664000180</view> 12 + <view class="">{{userInfo.nickname || '未登录'}}</view>
  13 + <view class="">{{userInfo.mobile || ''}}</view>
14 </view> 14 </view>
15 </view> 15 </view>
16 <view class="money"> 16 <view class="money">
17 <view class="item"> 17 <view class="item">
18 - <view class="qian"><text style="font-size: 32rpx;">¥</text>600</view> 18 + <view class="qian"><text style="font-size: 32rpx;">¥</text>{{allMoney.money || 0}}</view>
19 <view class="yue">账户余额</view> 19 <view class="yue">账户余额</view>
20 <view class="tixian flexC" @click="totackMoney(1)">提现</view> 20 <view class="tixian flexC" @click="totackMoney(1)">提现</view>
21 </view> 21 </view>
22 <view class="item"> 22 <view class="item">
23 - <view class="qian"><text style="font-size: 32rpx;">¥</text>600</view> 23 + <view class="qian"><text style="font-size: 32rpx;">¥</text>{{allMoney.score || 0}}</view>
24 <view class="yue">保证金</view> 24 <view class="yue">保证金</view>
25 <view class="tixian flexC" @click="totackMoney(2)">提现</view> 25 <view class="tixian flexC" @click="totackMoney(2)">提现</view>
26 </view> 26 </view>
@@ -59,12 +59,12 @@ @@ -59,12 +59,12 @@
59 </view> 59 </view>
60 </view> 60 </view>
61 61
62 - <!-- <u-modal :show="showCancel" @confirm="confirmCancel" @cancel="showCancel=false" content='您确定要退出登录吗' --> 62 + <u-modal :show="showCancel" :showCancelButton="true" @confirm="confirmCancel" @cancel="showCancel=false" content='您确定要退出登录吗'></u-modal>
63 <u-popup :show="showService" mode="center" bgColor="transparent" :round="15" > 63 <u-popup :show="showService" mode="center" bgColor="transparent" :round="15" >
64 <view class="centerBox"> 64 <view class="centerBox">
65 <image class="potImg" src="/static/codeBg.png" mode=""></image> 65 <image class="potImg" src="/static/codeBg.png" mode=""></image>
66 <view class="popTitle"> {{Service==1?'我的客服':'品牌入驻'}} </view> 66 <view class="popTitle"> {{Service==1?'我的客服':'品牌入驻'}} </view>
67 - <image class="code" src="/static/logo.png" mode=""></image> 67 + <image class="code" :src="qrCode" mode=""></image>
68 <view class="dashed"></view> 68 <view class="dashed"></view>
69 <view class="botText">长按识别二维码</view> 69 <view class="botText">长按识别二维码</view>
70 </view> 70 </view>
@@ -79,6 +79,9 @@ @@ -79,6 +79,9 @@
79 79
80 <script> 80 <script>
81 import Botton from "@/components/Botton.vue" 81 import Botton from "@/components/Botton.vue"
  82 + import {toa} from '@/utils/toast.js'
  83 + import { getUserInfo,logotLogin,getContactQrcode } from '@/api/mine.js'
  84 +
82 export default { 85 export default {
83 components: { 86 components: {
84 Botton 87 Botton
@@ -96,10 +99,51 @@ @@ -96,10 +99,51 @@
96 {name:'常用地址'}, 99 {name:'常用地址'},
97 ], 100 ],
98 showService:false, 101 showService:false,
99 - Service:0// 是否是联系客服 102 + Service:0 ,// 是否是联系客服
  103 + token:'',
  104 + userInfo:{},
  105 + allMoney:{},
  106 + showCancel:false,
  107 + qrCode:''
  108 + }
  109 + },
  110 + onShow() {
  111 + this.token = uni.getStorageSync('token') || ''
  112 + this.userInfo = uni.getStorageSync('userInfo') || ''
  113 + if(this.token){
  114 + this.getUserInfo()
100 } 115 }
  116 +
101 }, 117 },
102 methods: { 118 methods: {
  119 + async confirmCancel(){
  120 + try {
  121 + const res = await logotLogin()
  122 + setTimeout(()=>{
  123 + toa.success('退出成功')
  124 + },200)
  125 + uni.clearStorage()
  126 + uni.navigateTo({
  127 + url:'/pages/login/login'
  128 + })
  129 + console.log('logotLogin', res)
  130 + // 保存数据
  131 + } catch (err) {
  132 + uni.showToast({ title:err,icon:'none' })
  133 + console.log('logotLogin', err)
  134 + }
  135 + },
  136 + async getUserInfo(){
  137 + try {
  138 + const res = await getUserInfo()
  139 + console.log('getUserInfo', res)
  140 + this.allMoney = res.user
  141 + // 保存数据
  142 + } catch (err) {
  143 + uni.showToast({ title:err,icon:'none' })
  144 + console.log('getUserInfo', err)
  145 + }
  146 + },
103 totackMoney(type) { 147 totackMoney(type) {
104 if(type==3) { 148 if(type==3) {
105 uni.navigateTo({ 149 uni.navigateTo({
@@ -120,16 +164,29 @@ @@ -120,16 +164,29 @@
120 openService(idx){ 164 openService(idx){
121 if(idx==0) { 165 if(idx==0) {
122 this.Service = 1 166 this.Service = 1
123 - return this.showService = true  
124 - 167 + this.getContactQrcode(1)
125 } 168 }
126 if(idx==1) { 169 if(idx==1) {
127 this.Service = 0 170 this.Service = 0
128 - return this.showService = true } 171 + this.getContactQrcode(2)
  172 + }
129 if(idx==2) return uni.navigateTo({ url:'/pages/mine/Feedback' }) 173 if(idx==2) return uni.navigateTo({ url:'/pages/mine/Feedback' })
130 if(idx==3) return uni.navigateTo({ url:'/pages/mine/commonProblem' }) 174 if(idx==3) return uni.navigateTo({ url:'/pages/mine/commonProblem' })
  175 +
  176 + },
  177 + async getContactQrcode(type){
  178 + try {
  179 + const res = await getContactQrcode(type)
  180 + this.qrCode = res.qrcode
  181 + this.showService = true
  182 + // console.log('getContactQrcode', res)
  183 + // 保存数据
  184 + } catch (err) {
  185 + uni.showToast({ title:err,icon:'none' })
  186 + console.log('getContactQrcode', err)
131 } 187 }
132 }, 188 },
  189 + },
133 } 190 }
134 </script> 191 </script>
135 192
@@ -5,12 +5,31 @@ @@ -5,12 +5,31 @@
5 </template> 5 </template>
6 6
7 <script> 7 <script>
  8 + import { problemDetail } from '@/api/mine.js'
8 export default { 9 export default {
9 data() { 10 data() {
10 return { 11 return {
11 - detail: '<h1>服务条款</h1>' 12 + detail: '',
  13 + id:''
12 } 14 }
13 }, 15 },
  16 + onLoad(e) {
  17 + this.id = e.id
  18 + this.problemDetail()
  19 + },
  20 + methods: {
  21 + async problemDetail(){
  22 + try {
  23 + const res = await problemDetail(this.id)
  24 + this.detail = res.detail.content
  25 + console.log('problemDetail', res)
  26 + // 保存数据
  27 + } catch (err) {
  28 + uni.showToast({ title:err,icon:'none' })
  29 + console.log('problemDetail', err)
  30 + }
  31 + },
  32 + },
14 } 33 }
15 </script> 34 </script>
16 35
1 -export const baseURL = 'https://antifakeshop.brofirst.cn/api/' 1 +export const baseURL = 'http://yuanjie.n.broing.cn/api/'
2 2
3 export const request = (options) => { 3 export const request = (options) => {
4 return new Promise((resolve, reject) => { 4 return new Promise((resolve, reject) => {
@@ -7,6 +7,7 @@ export const request = (options) => { @@ -7,6 +7,7 @@ export const request = (options) => {
7 method: options.method || 'GET', //请求方法:传入的方法或者默认是“GET” 7 method: options.method || 'GET', //请求方法:传入的方法或者默认是“GET”
8 data: options.data || {}, //传递参数:传入的参数或者默认传递空集合 8 data: options.data || {}, //传递参数:传入的参数或者默认传递空集合
9 header: { 9 header: {
  10 + "Content-Type": "application/x-www-form-urlencoded",
10 'token': uni.getStorageSync("token") || "" //自定义请求头信息 11 'token': uni.getStorageSync("token") || "" //自定义请求头信息
11 }, 12 },
12 success: (res) => { 13 success: (res) => {