作者 燕成杰

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

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