Init project
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
<template>
|
||||
<view class="CustomerList">
|
||||
<view
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-for="item in list"
|
||||
:key="item.id"
|
||||
@click="goCustomerService(item)"
|
||||
>
|
||||
<view class="pictrue">
|
||||
<image :src="item.avatar" />
|
||||
</view>
|
||||
<view class="text line1">{{ item.nickname }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { serviceList } from "@/api/user";
|
||||
|
||||
export default {
|
||||
name: "CustomerList",
|
||||
data() {
|
||||
return {
|
||||
list: []
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
goCustomerService(item) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/user/CustomerService/index",
|
||||
query: { id: item.uid }
|
||||
});
|
||||
},
|
||||
getList() {
|
||||
serviceList().then(res => {
|
||||
this.list = res.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.CustomerList {
|
||||
margin-top: 0.13*100rpx;
|
||||
}
|
||||
.CustomerList .item {
|
||||
height: 1.38*100rpx;
|
||||
border-bottom: 1px solid #eee;
|
||||
padding: 0 0.24*100rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
.CustomerList .item .pictrue {
|
||||
width: 0.9*100rpx;
|
||||
height: 0.9*100rpx;
|
||||
border-radius: 50%;
|
||||
border: 0.03*100rpx solid #fff;
|
||||
box-shadow: 0 0 0.1*100rpx 0.05*100rpx #f3f3f3;
|
||||
-webkit-box-shadow: 0 0 0.1*100rpx 0.05*100rpx #f3f3f3;
|
||||
-moz-box-shadow: 0 0 0.1*100rpx 0.05*100rpx #f3f3f3;
|
||||
}
|
||||
.CustomerList .item .pictrue image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.CustomerList .item .text {
|
||||
width: 5.82*100rpx;
|
||||
font-size: 0.32*100rpx;
|
||||
color: #000;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,332 @@
|
||||
<template>
|
||||
<view class="register absolute">
|
||||
<view class="shading">
|
||||
<view class="pictrue acea-row row-center-wrapper">
|
||||
<image :src="`${staticUrl}/logo.png`" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="whiteBg" v-if="formItem === 1">
|
||||
<view class="title acea-row row-center-wrapper">
|
||||
<view
|
||||
class="item"
|
||||
:class="current === index ? 'on' : ''"
|
||||
v-for="(item, index) in navList"
|
||||
@click="navTap(index)"
|
||||
:key="index"
|
||||
>{{ item }}</view>
|
||||
</view>
|
||||
<view class="list" :hidden="current !== 0">
|
||||
<form @submit.prevent="submit">
|
||||
<view class="item">
|
||||
<view class="acea-row row-between-wrapper">
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-phone_" />
|
||||
</svg>-->
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" required />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="acea-row row-between-wrapper">
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-code_" />
|
||||
</svg>-->
|
||||
<input type="password" placeholder="填写登录密码" v-model="password" required />
|
||||
</view>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
<view class="list" :hidden="current !== 1">
|
||||
<view class="item">
|
||||
<view class="acea-row row-between-wrapper">
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-phone_" />
|
||||
</svg>-->
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="align-left">
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-code_1" />
|
||||
</svg>-->
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||
<button
|
||||
class="code"
|
||||
:disabled="disabled"
|
||||
:class="disabled === true ? 'on' : ''"
|
||||
@click="code"
|
||||
>{{ text }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="logon" @click="loginMobile" :hidden="current !== 1">登录</view>
|
||||
<view class="logon" @click="submit" :hidden="current === 1">登录</view>
|
||||
<view class="tip">
|
||||
没有账号?
|
||||
<text @click="formItem = 2" class="font-color-red">立即注册</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="whiteBg" v-else>
|
||||
<view class="title">注册账号</view>
|
||||
<view class="list">
|
||||
<view class="item">
|
||||
<view>
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-phone_" />
|
||||
</svg>-->
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="align-left">
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-code_1" />
|
||||
</svg>-->
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||
<button
|
||||
class="code"
|
||||
:disabled="disabled"
|
||||
:class="disabled === true ? 'on' : ''"
|
||||
@click="code"
|
||||
>{{ text }}</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view>
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-code_" />
|
||||
</svg>-->
|
||||
<input type="password" placeholder="填写您的登录密码" v-model="password" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view>
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-phone_" />
|
||||
</svg>-->
|
||||
<input type="text" placeholder="输入邀请码" v-model="inviteCode" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="logon" @click="register">注册</view>
|
||||
<view class="tip">
|
||||
已有账号?
|
||||
<text @click="formItem = 1" class="font-color-red">立即登录</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom"></view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import sendVerifyCode from "@/mixins/SendVerifyCode";
|
||||
import { login, loginMobile, registerVerify, register } from "@/api/user";
|
||||
import attrs, { required, alpha_num, chs_phone } from "@/utils/validate";
|
||||
import { validatorDefaultCatch } from "@/utils/dialog";
|
||||
import dayjs from "dayjs";
|
||||
import cookie from "@/utils/store/cookie";
|
||||
|
||||
import { handleGetUserInfo } from "@/utils";
|
||||
|
||||
const BACK_URL = "login_back_url";
|
||||
|
||||
export default {
|
||||
name: "Login",
|
||||
mixins: [sendVerifyCode],
|
||||
data: function() {
|
||||
return {
|
||||
staticUrl: this.$STATIC_RESOURCE_URL,
|
||||
navList: ["账号登录"],
|
||||
current: 0,
|
||||
account: "",
|
||||
password: "",
|
||||
captcha: "",
|
||||
inviteCode: "",
|
||||
formItem: 1,
|
||||
type: "login"
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async loginMobile() {
|
||||
var that = this;
|
||||
const { account, captcha } = that;
|
||||
try {
|
||||
await that
|
||||
.$validator({
|
||||
account: [
|
||||
required(required.message("手机号码")),
|
||||
chs_phone(chs_phone.message())
|
||||
],
|
||||
captcha: [
|
||||
required(required.message("验证码")),
|
||||
alpha_num(alpha_num.message("验证码"))
|
||||
]
|
||||
})
|
||||
.validate({
|
||||
account,
|
||||
captcha
|
||||
});
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
loginMobile({
|
||||
phone: that.account,
|
||||
captcha: that.captcha,
|
||||
spread: cookie.get("spread")
|
||||
})
|
||||
.then(res => {
|
||||
var data = res.data;
|
||||
// 授权过期时间
|
||||
that.$store.commit("login", data.token, dayjs(data.expires_time));
|
||||
handleGetUserInfo();
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
async register() {
|
||||
var that = this;
|
||||
const { account, captcha, password } = that;
|
||||
try {
|
||||
await that
|
||||
.$validator({
|
||||
account: [
|
||||
required(required.message("手机号码")),
|
||||
chs_phone(chs_phone.message())
|
||||
],
|
||||
captcha: [
|
||||
required(required.message("验证码")),
|
||||
alpha_num(alpha_num.message("验证码"))
|
||||
],
|
||||
password: [
|
||||
required(required.message("密码")),
|
||||
attrs.range([6, 16], attrs.range.message("密码")),
|
||||
alpha_num(alpha_num.message("密码"))
|
||||
]
|
||||
})
|
||||
.validate({
|
||||
account,
|
||||
captcha,
|
||||
password
|
||||
});
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
register({
|
||||
account: that.account,
|
||||
captcha: that.captcha,
|
||||
password: that.password,
|
||||
inviteCode: that.inviteCode,
|
||||
spread: cookie.get("spread")
|
||||
})
|
||||
.then(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
that.formItem = 1;
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
async code() {
|
||||
var that = this;
|
||||
const { account } = that;
|
||||
try {
|
||||
await that
|
||||
.$validator({
|
||||
account: [
|
||||
required(required.message("手机号码")),
|
||||
chs_phone(chs_phone.message())
|
||||
]
|
||||
})
|
||||
.validate({
|
||||
account
|
||||
});
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
if (that.formItem == 2) that.type = "register";
|
||||
await registerVerify({
|
||||
phone: that.account,
|
||||
type: that.type
|
||||
})
|
||||
.then(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
that.sendCode();
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
navTap: function(index) {
|
||||
this.current = index;
|
||||
},
|
||||
async submit() {
|
||||
const { account, password } = this;
|
||||
try {
|
||||
await this.$validator({
|
||||
account: [
|
||||
required(required.message("账号")),
|
||||
attrs.range([5, 16], attrs.range.message("账号")),
|
||||
alpha_num(alpha_num.message("账号"))
|
||||
],
|
||||
password: [
|
||||
required(required.message("密码")),
|
||||
attrs.range([6, 16], attrs.range.message("密码")),
|
||||
alpha_num(alpha_num.message("密码"))
|
||||
]
|
||||
}).validate({
|
||||
account,
|
||||
password
|
||||
});
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
|
||||
login({
|
||||
username: account,
|
||||
password,
|
||||
spread: cookie.get("spread")
|
||||
})
|
||||
.then(({ data }) => {
|
||||
// 授权过期时间
|
||||
this.$store.commit("login", data.token, dayjs(data.expires_time));
|
||||
handleGetUserInfo();
|
||||
// let replace=this.$yroute.query.replace
|
||||
// if(replace){
|
||||
|
||||
// }
|
||||
// this.$yrouter.replace({
|
||||
// path: this.$yroute.query.replace || '/pages/home/index'
|
||||
// });
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="content">
|
||||
<view v-if="userInfo && userInfo.levelExplain" v-html="userInfo.levelExplain"></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from "vuex";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: mapGetters(["userInfo"]),
|
||||
onLoad:function(e){
|
||||
|
||||
},
|
||||
onShow:function(){
|
||||
this.$store.dispatch("getUser", true);
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.content{
|
||||
background-color: #fff;
|
||||
margin: 20rpx;
|
||||
padding:20rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: normal;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<view class="messageList">
|
||||
<mescroll-body ref="mescrollRef" top="16rpx" bottom="0" class='cotent-scroll' :up="upOption" :down="downOption" @up="upCallback" @down="downCallback" @init="mescrollInit" @emptyclick="emptyClick">
|
||||
<view class="acea-row row-column">
|
||||
<view
|
||||
@click="toDetail(msg.id)"
|
||||
class="acea-row message-box"
|
||||
v-for="(msg, index) in list"
|
||||
:key="index"
|
||||
>
|
||||
<view class="acea-row row-between row-middle">
|
||||
<view class="title line1">{{msg.noticeTitle}}</view>
|
||||
<!-- <div class="date">{{dataFormat(msg.createdTime,true)}}</div> -->
|
||||
<view class="date">{{dataFormat(msg.noticeTime/1000,true)}}</view>
|
||||
</view>
|
||||
<view class="acea-row row-middle row-between">
|
||||
<view class="content line1" v-html="msg.noticeContent"></view>
|
||||
<view v-if="msg.readFlag=='RF0'" class="unread-dot"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</mescroll-body>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { noticeList } from "@/api/user";
|
||||
import { isWeixin, dataFormat } from "@/utils";
|
||||
import MescrollMixins from "@/mixins/mescroll-mixins.js";
|
||||
import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue";
|
||||
export default {
|
||||
components:{
|
||||
MescrollBody
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list:[
|
||||
// {
|
||||
// noticeTitle:'ddjifjiejfiejife',
|
||||
// noticeTime:'2020-09-09',
|
||||
// noticeContent:'djdifjeijfiejifef'
|
||||
// }
|
||||
],
|
||||
upOption:{
|
||||
noMoreSize: 10, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
|
||||
auto:true,
|
||||
empty:{
|
||||
tip: '暂无消息' // 提示
|
||||
// btnText:'点击刷新'
|
||||
}
|
||||
},
|
||||
downOption:{
|
||||
auto:false
|
||||
}
|
||||
}
|
||||
},
|
||||
mixins:[
|
||||
MescrollMixins({
|
||||
getPageData(mescroll){
|
||||
var _this = this;
|
||||
// 此时mescroll会携带page的参数:
|
||||
let pageNum = mescroll.num; // 页码, 默认从1开始
|
||||
let pageSize = mescroll.size; // 页长, 默认每页10条
|
||||
var params = {
|
||||
limit:pageSize,
|
||||
page:pageNum
|
||||
}
|
||||
// mescroll.endByPage(0, 0);
|
||||
// return;
|
||||
|
||||
noticeList(params)
|
||||
.then(res => {
|
||||
|
||||
|
||||
if(mescroll.num == 1) {
|
||||
_this.list = []; //如果是第一页需手动制空列表
|
||||
}
|
||||
_this.list = _this.list.concat(res.data);//追加新数据
|
||||
|
||||
mescroll.endSuccess(res.data.length);
|
||||
})
|
||||
.catch(err => {
|
||||
mescroll.endErr();
|
||||
uni.showToast({
|
||||
title: err + '',
|
||||
icon: 'none',
|
||||
mask: false,
|
||||
duration: 1500
|
||||
});
|
||||
})
|
||||
}
|
||||
})
|
||||
],
|
||||
methods: {
|
||||
dataFormat,
|
||||
toDetail(mid){
|
||||
this.$yrouter.push('/pages/user/MessageDetail/MessageDetail?id='+mid);
|
||||
// this.$yrouter.push({
|
||||
// path: "/pages/user/MessageDetail/MessageDetail",
|
||||
// query: {
|
||||
// id:mid
|
||||
// }
|
||||
// });
|
||||
}
|
||||
},
|
||||
onLoad:function(e){
|
||||
|
||||
},
|
||||
onShow:function(){
|
||||
//静默刷新
|
||||
this.mescroll && this.mescroll.resetUpScroll(false);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
page{
|
||||
background-color: #fff;
|
||||
}
|
||||
.messageList{
|
||||
padding: 0.32*100rpx;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.message-box{
|
||||
background:rgba(246,247,250,1);
|
||||
border-radius:0.12*100rpx;
|
||||
padding: 0.24*100rpx;
|
||||
margin-bottom: 0.4*100rpx;
|
||||
display: block;
|
||||
// width: 100%;
|
||||
}
|
||||
|
||||
.unread-dot{
|
||||
position: absolute;
|
||||
right: 0.2*100rpx;
|
||||
top: auto;
|
||||
flex-shrink: 0;
|
||||
width:0.16*100rpx;
|
||||
height:0.16*100rpx;
|
||||
background:rgba(255,26,26,1);
|
||||
border-radius:50%;
|
||||
}
|
||||
|
||||
.content{
|
||||
flex: 1;
|
||||
color: #8B8F99;
|
||||
font-size: 0.24*100rpx;
|
||||
margin-top: 0.08*100rpx;
|
||||
}
|
||||
|
||||
.date{
|
||||
font-size:0.24*100rpx;
|
||||
font-weight: bold;
|
||||
color:rgba(139,143,153,1);
|
||||
flex-shrink: 0;
|
||||
color: #8B8F99;
|
||||
}
|
||||
|
||||
.title{
|
||||
flex: 1;
|
||||
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,90 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="message">
|
||||
<view class="title">{{messageInfo.noticeTitle}}</view>
|
||||
<view class="date">{{dataFormat(messageInfo.noticeTime/1000,true)}}</view>
|
||||
<view class="content" v-html="messageInfo.noticeContent"></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { noticeDetail } from "@/api/user";
|
||||
import { dataFormat } from "@/utils";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id:0,
|
||||
messageInfo:{}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
dataFormat,
|
||||
getData:function(){
|
||||
let that = this;
|
||||
const id = this.id;
|
||||
if (!id) {
|
||||
uni.showToast({
|
||||
title:"消息id不存在",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
noticeDetail({
|
||||
id:this.id
|
||||
}).then((res)=>{
|
||||
|
||||
that.messageInfo = res.data;
|
||||
|
||||
}).catch((err)=>{
|
||||
uni.showToast({
|
||||
title:
|
||||
err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
onLoad:function(e){
|
||||
this.id = e.id;
|
||||
this.getData();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
|
||||
page{
|
||||
background-color: #fff !important;
|
||||
}
|
||||
|
||||
.message{
|
||||
padding: 0.36*100rpx;
|
||||
|
||||
}
|
||||
|
||||
.title{
|
||||
font-size:0.36*100rpx;
|
||||
font-weight: bold;
|
||||
color:rgba(8,15,26,1);
|
||||
}
|
||||
|
||||
.date{
|
||||
font-size:0.24*100rpx;
|
||||
font-weight: bold;
|
||||
color:rgba(139,143,153,1);
|
||||
margin-top: 0.24*100rpx;
|
||||
margin-bottom: 0.4*100rpx;
|
||||
}
|
||||
|
||||
.content{
|
||||
padding: 0.1*100rpx;
|
||||
color: #080F1A;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,217 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
|
||||
<view class="content acea-row row-column">
|
||||
|
||||
<input class="phone-input" type="text" :value="phone" disabled/>
|
||||
<view class="acea-row row-middle" style="flex-wrap: nowrap;">
|
||||
<input type="text" placeholder="填写验证码" placeholder-style="color:#DADCE0;font-size:28rpx;" class="codeIput" v-model="captcha" />
|
||||
<button
|
||||
class="code acea-row row-middle"
|
||||
:disabled="disabled"
|
||||
:class="disabled === true ? 'on' : ''"
|
||||
@click="code"
|
||||
>{{ text }}</button>
|
||||
</view>
|
||||
<input type="number" maxlength="6" password placeholder="请输新6位数字支付密码" placeholder-style="color:#DADCE0;font-size:28rpx" class="payPwdInput" v-model="payPwd" @input='inputPaypwdChange' />
|
||||
</view>
|
||||
<view class="confirmBnt bg-color-red" @click="confirm()">保存</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from "vuex";
|
||||
import sendVerifyCode from "@/mixins/SendVerifyCode";
|
||||
import { required, alpha_num, chs_phone } from "@/utils/validate";
|
||||
import { validatorDefaultCatch } from "@/utils/dialog";
|
||||
import { getUserInfo, registerVerify, bindingPhone,modifyUserPayPwd } from "@/api/user";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
captcha: "",
|
||||
phone:'',
|
||||
payPwd:''
|
||||
|
||||
}
|
||||
},
|
||||
mixins: [sendVerifyCode],
|
||||
watch:{
|
||||
userInfo(){
|
||||
this.phone = this.userInfo.phone;
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
...mapGetters(["userInfo"]),
|
||||
},
|
||||
onLoad:function(e){
|
||||
if (e.isSetMode) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '设置支付密码'
|
||||
});
|
||||
} else{
|
||||
uni.setNavigationBarTitle({
|
||||
title: '修改支付密码'
|
||||
});
|
||||
}
|
||||
|
||||
//获取用户信息
|
||||
if (this.$store.getters.token) {
|
||||
this.$store.dispatch("getUser", true);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
inputPaypwdChange:function(event){
|
||||
var value = event.target.value;
|
||||
var filterValue = value.replace(/\D/g,"");
|
||||
//console.log('value:'+filterValue);
|
||||
this.payPwd = filterValue; // 不允许输入非数字字符
|
||||
},
|
||||
async code() {
|
||||
let that = this;
|
||||
const { phone } = that;
|
||||
try {
|
||||
await that
|
||||
.$validator({
|
||||
phone: [
|
||||
required(required.message("手机号码")),
|
||||
chs_phone(chs_phone.message())
|
||||
]
|
||||
})
|
||||
.validate({ phone });
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
|
||||
registerVerify({ phone: phone })
|
||||
.then(res => {
|
||||
uni.showToast({
|
||||
title: res.data,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
that.sendCode();
|
||||
})
|
||||
.catch(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
async confirm() {
|
||||
let that = this;
|
||||
const { phone, captcha, payPwd } = that;
|
||||
try {
|
||||
await that
|
||||
.$validator({
|
||||
phone: [
|
||||
chs_phone(chs_phone.message("手机号码")),
|
||||
alpha_num(alpha_num.message())
|
||||
],
|
||||
captcha: [
|
||||
required(required.message("验证码")),
|
||||
alpha_num(alpha_num.message("验证码"))
|
||||
],
|
||||
payPwd: [
|
||||
required(required.message("支付密码")),
|
||||
alpha_num(alpha_num.message("支付密码"))
|
||||
]
|
||||
})
|
||||
.validate({ phone, captcha,payPwd });
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
|
||||
//网络请求
|
||||
uni.showLoading();
|
||||
modifyUserPayPwd({
|
||||
passwordPay:that.payPwd,
|
||||
code:that.captcha,
|
||||
phone:that.phone
|
||||
}).then((res)=>{
|
||||
//提示成功并返回
|
||||
uni.hideLoading();
|
||||
that.$dialog.toast({ mes: "保存成功" });
|
||||
setTimeout(function(){
|
||||
that.$yrouter.back();
|
||||
},1000);
|
||||
|
||||
}).catch((err)=>{
|
||||
uni.hideLoading();
|
||||
that.$dialog.error(err.msg || "修改失败");
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page{
|
||||
background: #fff;
|
||||
}
|
||||
.container{
|
||||
background: #fff;
|
||||
}
|
||||
.confirmBnt {
|
||||
font-size: 32rpx;
|
||||
width: 580rpx;
|
||||
height: 90rpx;
|
||||
border-radius: 45rpx;
|
||||
color: #fff;
|
||||
margin: 92rpx auto 0 auto;
|
||||
text-align: center;
|
||||
line-height: 90rpx;
|
||||
}
|
||||
.content{
|
||||
margin: 114rpx;
|
||||
}
|
||||
|
||||
.phone-input{
|
||||
color: #8B8F99;
|
||||
font-size: 36rpx;
|
||||
height:88rpx;
|
||||
background:rgba(247,247,249,1);
|
||||
opacity:1;
|
||||
border-radius:12rpx;
|
||||
margin-bottom: 32rpx;
|
||||
}
|
||||
|
||||
.codeIput{
|
||||
font-size: 28rpx;
|
||||
height:88rpx;
|
||||
border:1px solid rgba(218,220,224,1);
|
||||
opacity:1;
|
||||
border-radius:12rpx;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.code{
|
||||
/* width:224rpx; */
|
||||
height:88rpx;
|
||||
background:rgba(121,129,253,1);
|
||||
opacity:1;
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
border-radius:12rpxpx;
|
||||
flex-shrink: 0;
|
||||
margin-left: 16rpx;
|
||||
text-align: center;
|
||||
padding-left: 24rpx;
|
||||
padding-right: 24rpx;
|
||||
}
|
||||
|
||||
.payPwdInput{
|
||||
font-size: 28rpx;
|
||||
height:88rpx;
|
||||
border:1px solid rgba(218,220,224,1);
|
||||
opacity:1;
|
||||
border-radius:12rpx;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,335 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="payment-top acea-row row-column row-center-wrapper">
|
||||
<text class="name">我的余额</text>
|
||||
<view class="pic">
|
||||
<text>
|
||||
¥
|
||||
<text class="pic-font">{{ now_money || 0 }}</text>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="recharge">
|
||||
<view class="nav acea-row row-around row-middle">
|
||||
<view class="item on">账户充值</view>
|
||||
</view>
|
||||
<view class="info-wrapper">
|
||||
<view class="picList acea-row row-between mt-20">
|
||||
<view
|
||||
class="pic-box pic-box-color acea-row row-center-wrapper row-column"
|
||||
:class="activePic === index ? 'pic-box-color-active' : ''"
|
||||
v-for="(item, index) in picList"
|
||||
:key="index"
|
||||
@click="picCharge(index, item)"
|
||||
>
|
||||
<view class="pic-number-pic">
|
||||
<text>
|
||||
{{ item.value.price }}
|
||||
<text class="pic-number">元</text>
|
||||
</text>
|
||||
</view>
|
||||
<view class="pic-number" v-if="item.value.give_price > 0">赠送:{{ item.value.give_price }} 元</view>
|
||||
</view>
|
||||
<!-- <view
|
||||
class="pic-box pic-box-color acea-row row-center-wrapper"
|
||||
@click="picCharge(picList.length, money)"
|
||||
>
|
||||
<input
|
||||
type="number"
|
||||
placeholder="其他"
|
||||
v-model="money"
|
||||
class="pic-box-money pic-number-pic"
|
||||
/>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="tip">提示:充值后帐户的金额不能提现</view>
|
||||
<view class="pay-btn bg-color-red" @click="recharge">立即充值</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters } from "vuex";
|
||||
import { weappPay } from "@/libs/wechat";
|
||||
import { rechargeWechat, getRechargeApi } from "@/api/user";
|
||||
import { add, sub } from "@/utils/bc";
|
||||
|
||||
export default {
|
||||
name: "Recharge",
|
||||
components: {},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
active: 0,
|
||||
from: this.$deviceType,
|
||||
money: "",
|
||||
now_money: "",
|
||||
picList: [],
|
||||
activePic: 0,
|
||||
numberPic: "",
|
||||
paid_price: "",
|
||||
rechar_id: 0
|
||||
|
||||
};
|
||||
},
|
||||
computed: mapGetters(["userInfo"]),
|
||||
mounted: function() {
|
||||
this.now_money = this.userInfo.nowMoney;
|
||||
this.getRecharge();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 充值额度选择
|
||||
*/
|
||||
getRecharge() {
|
||||
getRechargeApi()
|
||||
.then(res => {
|
||||
this.picList = res.data.recharge_price_ways || [];
|
||||
if (this.picList[0]) {
|
||||
this.rechar_id = this.picList[0].id;
|
||||
this.paid_price = this.picList[0].value.price;
|
||||
this.numberPic = this.picList[0].value.give_price;
|
||||
}
|
||||
})
|
||||
.catch(res => {
|
||||
uni.showToast({
|
||||
title:
|
||||
err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 选择金额
|
||||
*/
|
||||
picCharge(idx, item) {
|
||||
this.activePic = idx;
|
||||
if (idx == this.picList.length) {
|
||||
this.rechar_id = 0;
|
||||
this.paid_price = "";
|
||||
this.numberPic = "";
|
||||
} else {
|
||||
this.money = "";
|
||||
this.rechar_id = item.id;
|
||||
this.paid_price = item.value.give_price;
|
||||
this.numberPic = item.value.price;
|
||||
}
|
||||
},
|
||||
recharge: function() {
|
||||
let that = this,
|
||||
price = Number(this.money);
|
||||
if (this.picList.length == this.activePic && price === 0) {
|
||||
uni.showToast({
|
||||
title: "请输入您要充值的金额",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
} else if (this.picList.length == this.activePic && price < 0.01) {
|
||||
uni.showToast({
|
||||
title: "充值金额不能低于0.01",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let prices = "",
|
||||
paid_price = "";
|
||||
if (price) {
|
||||
prices = price;
|
||||
paid_price = 0;
|
||||
} else {
|
||||
prices = that.numberPic;
|
||||
paid_price = that.paid_price;
|
||||
}
|
||||
rechargeWechat({
|
||||
price: prices,
|
||||
from: that.from,
|
||||
paid_price: paid_price,
|
||||
rechar_id: that.rechar_id
|
||||
})
|
||||
.then(res => {
|
||||
console.log(res);
|
||||
var data = res.data.data;
|
||||
weappPay(res.data.data)
|
||||
.then(() => {
|
||||
prices = add(prices, paid_price);
|
||||
that.now_money = add(prices, parseFloat(that.userInfo.nowMoney));
|
||||
uni.showToast({
|
||||
title: "支付成功",
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
this.$yrouter.back();
|
||||
})
|
||||
.finally(res => {
|
||||
//if(typeof(res) == "undefined") return
|
||||
uni.showToast({
|
||||
title: res,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
.catch(function() {
|
||||
uni.showToast({
|
||||
title: "支付失败",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
uni.showToast({
|
||||
title:
|
||||
err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
#iframe {
|
||||
display: none;
|
||||
}
|
||||
.pic-box-color-active {
|
||||
background-color: #eb3729 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
.picList {
|
||||
margin-bottom: 0.3 * 100rpx;
|
||||
margin-top: 0.3 * 100rpx;
|
||||
}
|
||||
.font-color {
|
||||
color: #e83323;
|
||||
}
|
||||
.recharge {
|
||||
border-radius: 0.1 * 100rpx;
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
margin: 0.2 * 100rpx auto 0 auto;
|
||||
padding: 0.3 * 100rpx;
|
||||
border-top-right-radius: 0.39 * 100rpx;
|
||||
border-top-left-radius: 0.39 * 100rpx;
|
||||
margin-top: -0.45 * 100rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.recharge .nav {
|
||||
height: 0.75 * 100rpx;
|
||||
line-height: 0.75 * 100rpx;
|
||||
padding: 0 1 * 100rpx;
|
||||
}
|
||||
.recharge .nav .item {
|
||||
font-size: 0.3 * 100rpx;
|
||||
color: #333;
|
||||
}
|
||||
.recharge .nav .item.on {
|
||||
font-weight: bold;
|
||||
border-bottom: 0.04 * 100rpx solid #e83323;
|
||||
}
|
||||
.recharge .info-wrapper {
|
||||
}
|
||||
.recharge .info-wrapper .money {
|
||||
margin-top: 0.6 * 100rpx;
|
||||
padding-bottom: 0.2 * 100rpx;
|
||||
border-bottom: 1px dashed #ddd;
|
||||
text-align: center;
|
||||
}
|
||||
.recharge .info-wrapper .money span {
|
||||
font-size: 0.56 * 100rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
.recharge .info-wrapper .money input {
|
||||
display: inline-block;
|
||||
width: 3 * 100rpx;
|
||||
font-size: 0.84 * 100rpx;
|
||||
text-align: center;
|
||||
color: #282828;
|
||||
font-weight: bold;
|
||||
padding-right: 0.7 * 100rpx;
|
||||
}
|
||||
.recharge .info-wrapper .money input::placeholder {
|
||||
color: #ddd;
|
||||
}
|
||||
.recharge .info-wrapper .money input::-webkit-input-placeholder {
|
||||
color: #ddd;
|
||||
}
|
||||
.recharge .info-wrapper .money input:-moz-placeholder {
|
||||
color: #ddd;
|
||||
}
|
||||
.recharge .info-wrapper .money input::-moz-placeholder {
|
||||
color: #ddd;
|
||||
}
|
||||
.recharge .info-wrapper .money input:-ms-input-placeholder {
|
||||
color: #ddd;
|
||||
}
|
||||
.tip {
|
||||
font-size: 0.28 * 100rpx;
|
||||
color: #333333;
|
||||
font-weight: 800;
|
||||
margin-bottom: 0.14 * 100rpx;
|
||||
}
|
||||
.recharge .info-wrapper .tips span {
|
||||
color: #ef4a49;
|
||||
}
|
||||
.recharge .info-wrapper .pay-btn {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 0.86 * 100rpx;
|
||||
margin: 0.5 * 100rpx auto 0 auto;
|
||||
line-height: 0.86 * 100rpx;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
border-radius: 0.5 * 100rpx;
|
||||
font-size: 0.3 * 100rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.payment-top {
|
||||
width: 100%;
|
||||
height: 3.5 * 100rpx;
|
||||
background-color: #eb3729;
|
||||
}
|
||||
.payment-top .name {
|
||||
font-size: 0.26 * 100rpx;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
margin-top: -0.38 * 100rpx;
|
||||
margin-bottom: 0.3 * 100rpx;
|
||||
}
|
||||
.payment-top .pic {
|
||||
font-size: 0.32 * 100rpx;
|
||||
color: #fff;
|
||||
}
|
||||
.payment-top .pic-font {
|
||||
font-size: 0.78 * 100rpx;
|
||||
color: #fff;
|
||||
}
|
||||
.picList .pic-box {
|
||||
width: 32%;
|
||||
height: auto;
|
||||
border-radius: 0.2 * 100rpx;
|
||||
margin-top: 0.21 * 100rpx;
|
||||
padding: 0.2 * 100rpx 0;
|
||||
}
|
||||
.pic-box-color {
|
||||
background-color: #f4f4f4;
|
||||
color: #656565;
|
||||
}
|
||||
.pic-number {
|
||||
font-size: 0.22 * 100rpx;
|
||||
}
|
||||
.pic-number-pic {
|
||||
font-size: 0.38 * 100rpx;
|
||||
margin-right: 0.1 * 100rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.pic-box-money {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,153 @@
|
||||
<template>
|
||||
<view class="register absolute">
|
||||
<view class="shading">
|
||||
<view class="pictrue acea-row row-center-wrapper">
|
||||
<image :src="`${staticUrl}/logo.png`" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="whiteBg">
|
||||
<view class="title">找回密码</view>
|
||||
<view class="list">
|
||||
<view class="item">
|
||||
<view>
|
||||
<svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-phone_" />
|
||||
</svg>
|
||||
<input type="text" placeholder="输入手机号码" v-model="account" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="align-left">
|
||||
<svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-code_1" />
|
||||
</svg>
|
||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||
<button
|
||||
class="code"
|
||||
:disabled="disabled"
|
||||
:class="disabled === true ? 'on' : ''"
|
||||
@click="code"
|
||||
>{{ text }}</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view>
|
||||
<svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-code_" />
|
||||
</svg>
|
||||
<input type="password" placeholder="填写您的登录密码" v-model="password" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="logon" @click="registerReset">确认</view>
|
||||
<view class="tip">
|
||||
<text @click="goLogin()" class="font-color-red">立即登录</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import sendVerifyCode from "@/mixins/SendVerifyCode";
|
||||
import { registerVerify, registerReset } from "@/api/user";
|
||||
import { validatorDefaultCatch } from "@/utils/dialog";
|
||||
import attrs, { required, alpha_num, chs_phone } from "@/utils/validate";
|
||||
|
||||
export default {
|
||||
name: "RetrievePassword",
|
||||
data: function() {
|
||||
return {
|
||||
staticUrl: this.$STATIC_RESOURCE_URL,
|
||||
account: "",
|
||||
password: "",
|
||||
captcha: ""
|
||||
};
|
||||
},
|
||||
mixins: [sendVerifyCode],
|
||||
methods: {
|
||||
goLogin() {
|
||||
this.$yrouter.push({ path: "/pages/user/Login/index" });
|
||||
},
|
||||
async registerReset() {
|
||||
var that = this;
|
||||
const { account, captcha, password } = that;
|
||||
try {
|
||||
await that
|
||||
.$validator({
|
||||
account: [
|
||||
required(required.message("手机号码")),
|
||||
chs_phone(chs_phone.message())
|
||||
],
|
||||
captcha: [
|
||||
required(required.message("验证码")),
|
||||
alpha_num(alpha_num.message("验证码"))
|
||||
],
|
||||
password: [
|
||||
required(required.message("密码")),
|
||||
attrs.range([6, 16], attrs.range.message("密码")),
|
||||
alpha_num(alpha_num.message("密码"))
|
||||
]
|
||||
})
|
||||
.validate({ account, captcha, password });
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
registerReset({
|
||||
account: that.account,
|
||||
captcha: that.captcha,
|
||||
password: that.password
|
||||
})
|
||||
.then(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "success",
|
||||
duration: 2000,
|
||||
complete: () => {
|
||||
that.$yrouter.push({ name: "Login" });
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
async code() {
|
||||
var that = this;
|
||||
const { account } = that;
|
||||
try {
|
||||
await that
|
||||
.$validator({
|
||||
account: [
|
||||
required(required.message("手机号码")),
|
||||
chs_phone(chs_phone.message())
|
||||
]
|
||||
})
|
||||
.validate({ account });
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
registerVerify({ phone: that.account })
|
||||
.then(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
that.sendCode();
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,368 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
|
||||
<view class="content-box">
|
||||
<view class="content">
|
||||
<view v-if="userLevelInfo" class="verify-status-box acea-row row-center row-middle">
|
||||
<img v-if="userLevelInfo.checkState==3" class="verify-status-img" :src="webUrl+'/20200824093220483259.png'"/>
|
||||
<span class="verify-status-text">{{ getCheckState(userLevelInfo) }}</span>
|
||||
</view>
|
||||
<view v-if="userLevelInfo && userLevelInfo.checkState==4" class="reason">原因:{{ userLevelInfo.checkRemark }}
|
||||
</view>
|
||||
<view class="electronic-box acea-row row-middle row-center">
|
||||
<view class="checkbox-wrapper">
|
||||
<checkbox-group @change="toggleProtocolCheck()">
|
||||
<label class="well-check">
|
||||
<checkbox :checked="protocolChecked" color="#fff"
|
||||
style="border-radius: 50%;transform:scale(0.7)"></checkbox>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
<view class="electronic-tip">
|
||||
<span class="">我已同意</span>
|
||||
<span @click="toggleProtocolPage()" class="electronic-protocol-text">《香道滇股东协议》</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="upload-box acea-row row-column row-center">
|
||||
<view class="idcard_pictrue">
|
||||
<view @tap="chooseIdCardFrontImage">
|
||||
<view class="pictrue">
|
||||
<img v-if="idCardFrontImg.length>0" :src="idCardFrontImg"/>
|
||||
<img v-else :src="webUrl+'/20200824092942325489.png'"/>
|
||||
</view>
|
||||
<view v-if="idCardFrontImg.length==0" class="add-icon">
|
||||
<img :src="webUrl+'/20200824093150470953.png'"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<span class="upload-tip">上传身份证正面照</span>
|
||||
<view class="idcard_pictrue">
|
||||
<view class="" @tap="chooseIdCardBackImage">
|
||||
<view class="pictrue">
|
||||
<img v-if="idCardBackImg.length>0" :src="idCardBackImg"/>
|
||||
<img v-else :src="webUrl+'/20200824093104069571.png'"/>
|
||||
</view>
|
||||
<view v-if="idCardBackImg.length==0" class="add-icon">
|
||||
<img :src="webUrl+'/20200824093150470953.png'"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<span class="upload-tip">上传身份证反面照</span>
|
||||
</view>
|
||||
<view v-if="userLevelInfo && userLevelInfo.checkState!=3 && userLevelInfo.checkState!=2" class="submit-btn"
|
||||
@click="submitBtnClick">保存
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
var that;
|
||||
import {mapGetters} from "vuex";
|
||||
import {chooseImage} from "@/utils";
|
||||
import {getUserLevelInfo, saveUserProtocol} from "@/api/user"
|
||||
import uniPopup from '@/components/uni-popup/uni-popup.vue';
|
||||
|
||||
export default {
|
||||
|
||||
components: {
|
||||
uniPopup
|
||||
},
|
||||
props: {},
|
||||
data: function () {
|
||||
return {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
idCardFrontImg: "",
|
||||
idCardBackImg: "",
|
||||
protocolChecked: true,
|
||||
protocolShow: false,
|
||||
verifyPass: 0,//是否审核通过
|
||||
userLevelInfo: null,
|
||||
avatar: ''
|
||||
};
|
||||
},
|
||||
watch: {},
|
||||
computed: mapGetters(["userInfo"]),
|
||||
onShow() {
|
||||
if (this.$store.getters.token) {
|
||||
this.$store.dispatch("getUser", true);
|
||||
}
|
||||
},
|
||||
onLoad: function () {
|
||||
//setTimeout里的this不是页面的this
|
||||
//所以这里要处理一下用that
|
||||
that = this;
|
||||
this.getUserLevelInfo();
|
||||
|
||||
},
|
||||
methods: {
|
||||
toggleProtocolCheck() {
|
||||
this.protocolChecked = !this.protocolChecked;
|
||||
},
|
||||
//checkState:1-新增 2-待审核 3-已审核 4-已驳回
|
||||
getCheckState(info) {
|
||||
var status = '';
|
||||
if (info) {
|
||||
switch (info.checkState) {
|
||||
case 1:
|
||||
status = '新增';
|
||||
break;
|
||||
case 2:
|
||||
status = '待审核';
|
||||
break;
|
||||
case 3:
|
||||
status = '审核通过';
|
||||
break;
|
||||
case 4:
|
||||
status = '审核驳回';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
|
||||
},
|
||||
//显示协议内容
|
||||
toggleProtocolPage() {
|
||||
//this.$refs.popup.open();
|
||||
this.$yrouter.push('/pages/user/UpgradeProtocolDetail/UpgradeProtocolDetail')
|
||||
|
||||
},
|
||||
chooseIdCardFrontImage() {
|
||||
|
||||
// if(this.userLevelInfo && this.userLevelInfo.checkState!=3){
|
||||
// chooseImage(img => {
|
||||
// console.log(img)
|
||||
// this.avatar = img;
|
||||
// });
|
||||
// }
|
||||
|
||||
chooseImage(img => {
|
||||
console.log(img)
|
||||
|
||||
that.idCardFrontImg = img;
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
chooseIdCardBackImage() {
|
||||
chooseImage(img => {
|
||||
console.log(img)
|
||||
|
||||
that.idCardBackImg = img;
|
||||
|
||||
});
|
||||
},
|
||||
//提交
|
||||
submitBtnClick: function () {
|
||||
//var that = this;
|
||||
if (this.idCardFrontImg.length == 0) {
|
||||
this.$dialog.toast({mes: '请上传身份证正面照片'});
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.idCardBackImg.length == 0) {
|
||||
this.$dialog.toast({mes: '请上传身份证反面面照片'});
|
||||
return;
|
||||
}
|
||||
|
||||
this.$dialog.loading.open();
|
||||
saveUserProtocol({
|
||||
uid: that.userInfo.uid,
|
||||
idcardOne: that.idCardFrontImg,
|
||||
idcardTwo: that.idCardBackImg
|
||||
}).then((res) => {
|
||||
that.$dialog.toast({mes: "保存成功!"});
|
||||
//跳转回上一页
|
||||
setTimeout(function () {
|
||||
that.$yrouter.back();
|
||||
}, 1000);
|
||||
}).catch(err => {
|
||||
that.$dialog.error(err.msg || "保存失败!");
|
||||
}).finally(() => {
|
||||
that.$dialog.loading.close();
|
||||
});
|
||||
},
|
||||
// 获取用户等级信息
|
||||
getUserLevelInfo: function () {
|
||||
var that = this;
|
||||
getUserLevelInfo().then((res) => {
|
||||
if (res.data) {
|
||||
that.userLevelInfo = res.data;
|
||||
that.idCardFrontImg = res.data.idcardOne || "";
|
||||
that.idCardBackImg = res.data.idcardTwo || "";
|
||||
}
|
||||
}).catch(err => {
|
||||
|
||||
}).finally(() => {
|
||||
|
||||
});
|
||||
},
|
||||
idCardFrontImageuploaded(res) {
|
||||
if (res.errno !== 0)
|
||||
return this.$dialog.error(res.msg || "上传图片失败");
|
||||
this.idCardFrontImg = res.link;
|
||||
//this.$set(this.idCardFrontImg, "avatar", res.link);
|
||||
},
|
||||
idCardBackImageuploaded(res) {
|
||||
if (res.errno !== 0)
|
||||
return this.$dialog.error(res.msg || "上传图片失败");
|
||||
this.idCardBackImg = res.link;
|
||||
//this.$set(this.idCardBackImg, "avatar", res.link);
|
||||
},
|
||||
onBackClick: function () {
|
||||
this.$yrouter.back();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content-box {
|
||||
background-color: #FFFAF5;
|
||||
padding: 38rpx;
|
||||
}
|
||||
|
||||
.content {
|
||||
border: 1px solid rgba(195, 172, 149, 1);
|
||||
padding: 54rpx;
|
||||
}
|
||||
|
||||
.checkbox-wrapper {
|
||||
/* width: 0.8rem; */
|
||||
width: auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.checkbox-wrapper .icon {
|
||||
/* left: calc((0.8rem - 18px)/2); */
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.checkbox-wrapper input:checked + .icon {
|
||||
background-color: #FD2C4B !important;
|
||||
border-color: #FD2C4B !important;
|
||||
}
|
||||
|
||||
.electronic-tip {
|
||||
color: #9B6E40;
|
||||
font-size: 28rpx;
|
||||
/* padding-left: 48rpx; */
|
||||
}
|
||||
|
||||
.electronic-protocol-text {
|
||||
color: #FF8D5B;
|
||||
}
|
||||
|
||||
.protocol-wrapper {
|
||||
/* display: flex; */
|
||||
/* align-items: center; */
|
||||
/* justify-content: center; */
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.p-content {
|
||||
background-color: #fff;
|
||||
margin: 100rpx;
|
||||
padding: 20rpx;
|
||||
overflow-y: scroll;
|
||||
border-radius: 16rpx;
|
||||
height: calc(100% - 200rpx);
|
||||
}
|
||||
|
||||
.p-content .title {
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
font-size: 40rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.overlay-protocol {
|
||||
z-index: 1000 !important;
|
||||
}
|
||||
|
||||
.upload-box {
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.upload-box .idcard_pictrue {
|
||||
width: 568rpx;
|
||||
height: 320rpx;
|
||||
/* background:rgba(255,255,255,1); */
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.upload-tip {
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #C3AC95;
|
||||
text-align: center;
|
||||
margin-top: 20rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.upload-box .idcard_pictrue .pictrue {
|
||||
width: 568rpx;
|
||||
height: 320rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.upload-box .idcard_pictrue .pictrue img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.add-icon {
|
||||
width: 92rpx;
|
||||
height: 92rpx;
|
||||
position: absolute;
|
||||
left: calc((100% - 92rpx) / 2);
|
||||
top: calc((100% - 92rpx) / 2);
|
||||
}
|
||||
|
||||
.add-icon img {
|
||||
width: 92rpx;
|
||||
height: 92rpx;
|
||||
}
|
||||
|
||||
.verify-status-box {
|
||||
margin: 32rpx auto;
|
||||
}
|
||||
|
||||
.verify-status-img {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
}
|
||||
|
||||
.verify-status-text {
|
||||
color: #9B6E40;
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
font-size: 32rpx;
|
||||
color: #fff;
|
||||
/* width:6.9rem; */
|
||||
height: 90rpx;
|
||||
border-radius: 50rpx;
|
||||
text-align: center;
|
||||
line-height: 90rpx;
|
||||
background-color: #00AAEA;
|
||||
margin: 76rpx auto 0 auto;
|
||||
}
|
||||
|
||||
.reason {
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: #FF0000;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,211 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="WordSection1">
|
||||
<!-- <view class="MsoNormal" align="center" style="text-align:center;text-indent:38.95rpx"><span style="font-size:18.0rpx;font-family:宋体">共享股东协议</span></view> -->
|
||||
|
||||
<view class="MsoNormal" align="center" style="text-align:center;text-indent:30.3rpx"><span lang="EN-US" style="font-size:28rpx"> </span></view>
|
||||
|
||||
<view class="MsoNormal" style="text-indent:28.0rpx">
|
||||
<span
|
||||
style="font-size:28rpx;
|
||||
font-family:宋体"
|
||||
>
|
||||
欢迎阅读香道滇官方商城服务条款
|
||||
</span>
|
||||
<span lang="EN-US" style="font-size:28rpx">(</span>
|
||||
<span style="font-size:28rpx;font-family:宋体">下称“本条款”</span>
|
||||
<span lang="EN-US" style="font-size:28rpx">)</span>
|
||||
<span
|
||||
style="font-size:28rpx;font-family:
|
||||
宋体"
|
||||
>
|
||||
。本条款阐述之条款和条件适用于您在香道滇官方商城平台无偿或有偿使用香道滇产品。
|
||||
</span>
|
||||
</view>
|
||||
|
||||
<view class="MsoNormal" style="text-indent:30.3rpx">
|
||||
<span lang="EN-US" style="font-size:30rpx">1. </span>
|
||||
<span
|
||||
style="font-size:28rpx;
|
||||
font-family:宋体"
|
||||
>
|
||||
接受条款
|
||||
</span>
|
||||
</view>
|
||||
|
||||
<view class="MsoNormal" style="text-indent:30.3rpx">
|
||||
<u>
|
||||
<span style="font-size:28rpx;font-family:宋体">
|
||||
以任何方式使用香道滇产品即表示您同意自己已经与香道滇公司就香道滇官方商城平台服务事项(下称香道滇商城服务)订立本条款,且您将受本条款的条件约束。
|
||||
</span>
|
||||
</u>
|
||||
<span style="font-size:28rpx;font-family:宋体">
|
||||
您应在第一次提出申请前仔细阅读本条款,并有权选择停止或继续使用香道滇商城服务;一旦您继续使用香道滇商城服务,则表示您已接受本条款,当您与香道滇商城发生争议时,应以本条款作为约束双方的条款。
|
||||
</span>
|
||||
</view>
|
||||
|
||||
<view class="MsoNormal" style="text-indent:30.3rpx">
|
||||
<span lang="EN-US" style="font-size:30rpx">2. </span>
|
||||
<span
|
||||
style="font-size:28rpx;
|
||||
font-family:宋体"
|
||||
>
|
||||
谁可成为
|
||||
</span>
|
||||
<span
|
||||
style="font-size:28rpx;font-family:
|
||||
宋体"
|
||||
>
|
||||
香道滇官方商城
|
||||
<span>平台的共享股东</span>
|
||||
</span>
|
||||
</view>
|
||||
|
||||
<view class="MsoNormal" style="text-indent:28.0rpx">
|
||||
<span
|
||||
style="font-size:28rpx;
|
||||
font-family:宋体"
|
||||
>
|
||||
必需是注册成为香道滇官方商城会员后,对香道滇产品产生一定兴趣和拥有一定资源的合作伙伴:
|
||||
</span>
|
||||
</view>
|
||||
|
||||
<view class="MsoNormal" style="text-indent:28.0rpx">
|
||||
<span
|
||||
style="font-size:28rpx;
|
||||
font-family:宋体"
|
||||
>
|
||||
升级成为群主——针对个人要求拥有吃货宣传带动力;
|
||||
</span>
|
||||
</view>
|
||||
|
||||
<view class="MsoNormal" style="text-indent:28.0rpx">
|
||||
<span
|
||||
style="font-size:28rpx;
|
||||
font-family:宋体"
|
||||
>
|
||||
升级成为团长——针对个人要求具备一定的线上或线下实战带货力;
|
||||
</span>
|
||||
</view>
|
||||
|
||||
<view class="MsoNormal" style="text-indent:28.0rpx">
|
||||
<span
|
||||
style="font-size:28rpx;
|
||||
font-family:宋体"
|
||||
>
|
||||
升级成为特约合作方——针对第三方合作要求具备一定实力的带货公司
|
||||
</span>
|
||||
<span lang="EN-US" style="font-size:28rpx">/</span>
|
||||
<span
|
||||
style="font-size:28rpx;
|
||||
font-family:宋体"
|
||||
>
|
||||
平台。
|
||||
</span>
|
||||
</view>
|
||||
|
||||
<view class="MsoNormal" style="text-indent:28.0rpx">
|
||||
<span
|
||||
style="font-size:28rpx;
|
||||
font-family:宋体"
|
||||
>
|
||||
请您先与商城管理员进行信息交流,让我们了解下您的资源情况,同时也把相应匹配的共享股东的具体权益让您也具体了解,待双方都明确的情况下在由您提出申请并提交相应资料信息后,即可完成对应升级。
|
||||
</span>
|
||||
</view>
|
||||
|
||||
<view class="MsoNormal" style="text-indent:30.3rpx">
|
||||
<span lang="EN-US" style="font-size:30rpx">3. </span>
|
||||
<span
|
||||
style="font-size:28rpx;
|
||||
font-family:宋体"
|
||||
>
|
||||
您的资料与隐私
|
||||
</span>
|
||||
</view>
|
||||
|
||||
<view class="MsoNormal" style="text-indent:28.0rpx">
|
||||
<span
|
||||
style="font-size:28rpx;
|
||||
font-family:宋体"
|
||||
>
|
||||
需要到您提交个人或平台方的资料仅作为香道滇官方商城合作备案,同时香道滇官方商城也保证不会泄露您的信息给第三方。
|
||||
</span>
|
||||
</view>
|
||||
|
||||
<view class="MsoNormal" style="text-indent:30.3rpx">
|
||||
<span lang="EN-US" style="font-size:28rpx">4. </span>
|
||||
<span
|
||||
style="font-size:28rpx;
|
||||
font-family:宋体"
|
||||
>
|
||||
香道滇官方商城
|
||||
<span>平台产品责任</span>
|
||||
</span>
|
||||
</view>
|
||||
|
||||
<view class="MsoNormal" style="text-indent:28.0rpx">
|
||||
<span
|
||||
style="font-size:28rpx;
|
||||
font-family:宋体"
|
||||
>
|
||||
(
|
||||
</span>
|
||||
<span lang="EN-US" style="font-size:28rpx">1</span>
|
||||
<span style="font-size:28rpx;font-family:宋体">)所有从本商城发货出去的产品均有品质保证,如因产品本身出现的质量问题均由本商城负责处理及承担相应责任;</span>
|
||||
</view>
|
||||
|
||||
<view class="MsoNormal" style="margin-left:8.0rpx;text-indent:20.45rpx">
|
||||
<span style="font-size:28rpx;font-family:宋体">(</span>
|
||||
<span lang="EN-US" style="font-size:28rpx">2</span>
|
||||
<span
|
||||
style="font-size:28rpx;font-family:
|
||||
宋体"
|
||||
>
|
||||
)您作为香道滇官方商城产品的推广方用户,需按照本商城给予的指导售价、产品实际宣传内容以及有针对性的目标群体进行宣传推广,
|
||||
</span>
|
||||
<span style="font-size:28rpx;font-family:宋体">不得进行虚假宣传或者促使消费者误解的方式进行宣传,</span>
|
||||
<span style="font-size:28rpx;font-family:宋体">如此造成目标客户群体的影响则由其自行承担相应责任。</span>
|
||||
</view>
|
||||
|
||||
<view class="MsoNormal" style="text-indent:30.3rpx">
|
||||
<span lang="EN-US" style="font-size:30rpx">5. </span>
|
||||
<span
|
||||
style="font-size:28rpx;
|
||||
font-family:宋体"
|
||||
>
|
||||
不可抗力
|
||||
</span>
|
||||
</view>
|
||||
|
||||
<view class="MsoNormal" style="text-indent:28.0rpx">
|
||||
<span
|
||||
style="font-size:28rpx;
|
||||
font-family:宋体"
|
||||
>
|
||||
由于自然灾害、暴动、战争行为、政府行为、通电信网络、黑客攻击、尚无有效防御措施的计算机病毒的发作及其他各方不能预见并且对其发生和后果不能防止并避免的不可抗力原因,致使凡香道滇官方商城延迟或未能履约的,香道滇公司不对您承担任何责任。
|
||||
</span>
|
||||
</view>
|
||||
|
||||
<view class="MsoNormal"><span lang="EN-US" style="font-size:28rpx"> </span></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<scrirpx>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</scrirpx>
|
||||
|
||||
<style>
|
||||
.container {
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,111 @@
|
||||
<template>
|
||||
<view class="my-account">
|
||||
<view class="wrapper">
|
||||
<view class="header">
|
||||
<view class="headerCon">
|
||||
<view class="account acea-row row-top row-between">
|
||||
<view class="assets">
|
||||
<view style="color: #fff;">总资产(元)</view>
|
||||
<view class="money">{{ now_money }}</view>
|
||||
</view>
|
||||
<!-- <navigator url="/pages/user/Recharge/index" class="recharge font-color-red">充值</navigator> -->
|
||||
</view>
|
||||
<view class="cumulative acea-row row-top">
|
||||
<view class="item">
|
||||
<view style="color: #fff;">累计消费(元)</view>
|
||||
<view class="money">{{ orderStatusSum }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="nav acea-row row-middle">
|
||||
<view class="item" @click="goUserBill(0)">
|
||||
<view class="pictrue">
|
||||
<image :src="webUrl+'/20230304202916716809.png'" />
|
||||
</view>
|
||||
<view>账单记录</view>
|
||||
</view>
|
||||
<view class="item" @click="goUserBill(1)">
|
||||
<view class="pictrue">
|
||||
<image :src="webUrl+'/20230304202923197491.png'" />
|
||||
</view>
|
||||
<view>消费记录</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="advert acea-row row-between-wrapper"></view>
|
||||
</view>
|
||||
<Recommend></Recommend>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import Recommend from "@/components/Recommend";
|
||||
import { getActivityStatus, getBalance } from "@/api/user";
|
||||
export default {
|
||||
name: "UserAccount",
|
||||
components: {
|
||||
Recommend
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
now_money: 0,
|
||||
orderStatusSum: 0,
|
||||
recharge: 0,
|
||||
activity: {
|
||||
is_bargin: false,
|
||||
is_pink: false,
|
||||
is_seckill: false
|
||||
}
|
||||
};
|
||||
},
|
||||
onShow: function() {
|
||||
this.getIndex();
|
||||
// this.getActivity();
|
||||
},
|
||||
methods: {
|
||||
goUserBill(types) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/user/UserBill/index",
|
||||
query: { types }
|
||||
});
|
||||
},
|
||||
getIndex: function() {
|
||||
let that = this;
|
||||
getBalance().then(
|
||||
res => {
|
||||
that.now_money = res.data.now_money;
|
||||
that.orderStatusSum = res.data.orderStatusSum;
|
||||
that.recharge = res.data.recharge;
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title:
|
||||
err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
getActivity: function() {
|
||||
let that = this;
|
||||
getActivityStatus().then(
|
||||
res => {
|
||||
that.activity.is_bargin = res.data.is_bargin;
|
||||
that.activity.is_pink = res.data.is_pink;
|
||||
that.activity.is_seckill = res.data.is_seckill;
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title:
|
||||
err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<view class="bill-details" ref="container">
|
||||
<view class="nav acea-row">
|
||||
<view class="item" :class="types == 0 ? 'on' : ''" @click="changeTypes(0)">全部</view>
|
||||
<view class="item" :class="types == 1 ? 'on' : ''" @click="changeTypes(1)">消费</view>
|
||||
<view class="item" :class="types == 2 ? 'on' : ''" @click="changeTypes(2)">充值</view>
|
||||
</view>
|
||||
<view class="sign-record">
|
||||
<view class="list">
|
||||
<view class="item" v-for="(item, listIndex) in list" :key="listIndex">
|
||||
<view class="data">{{ item.time }}</view>
|
||||
<view class="listn" v-for="(val, key) in item.list" :key="key">
|
||||
<view class="itemn acea-row row-between-wrapper">
|
||||
<view>
|
||||
<view class="name line1">{{ val.title }}</view>
|
||||
<view>{{ val.addTime }}</view>
|
||||
</view>
|
||||
<view
|
||||
class="num"
|
||||
:class="val.pm == 0 ? 'font-color-red' : ''"
|
||||
>{{ val.pm == 0 ? "-" : "+" }}{{ force2Decimal(val.number) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<Loading :loaded="loaded" :loading="loading"></Loading>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getCommissionInfo } from "@/api/user";
|
||||
import Loading from "@/components/Loading";
|
||||
export default {
|
||||
name: "UserBill",
|
||||
components: {
|
||||
Loading
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
types: 0,
|
||||
where: {
|
||||
page: 1,
|
||||
limit: 5
|
||||
},
|
||||
list: [],
|
||||
loaded: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
"$yroute.query.types": function(newVal) {
|
||||
let that = this;
|
||||
if (newVal != undefined) {
|
||||
that.types = newVal;
|
||||
that.list = [];
|
||||
that.where.page = 1;
|
||||
that.loaded = false;
|
||||
that.loading = false;
|
||||
that.getIndex();
|
||||
}
|
||||
},
|
||||
types: function() {
|
||||
this.getIndex();
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
let that = this;
|
||||
|
||||
that.types = that.$yroute.query.types||0;
|
||||
that.getIndex();
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loading && this.getIndex();
|
||||
},
|
||||
methods: {
|
||||
force2Decimal(v){
|
||||
return this.$force2Decimal(v);
|
||||
},
|
||||
code: function() {
|
||||
this.sendCode();
|
||||
},
|
||||
changeTypes: function(val) {
|
||||
if (val != this.types) {
|
||||
this.types = val;
|
||||
this.list = [];
|
||||
this.where.page = 1;
|
||||
this.loaded = false;
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
getIndex: function() {
|
||||
let that = this;
|
||||
if (that.loaded == true || that.loading == true) return;
|
||||
that.loading = true;
|
||||
getCommissionInfo(that.where, that.types).then(
|
||||
res => {
|
||||
that.loading = false;
|
||||
that.loaded = res.data.length < that.where.limit;
|
||||
that.where.page = that.where.page + 1;
|
||||
that.list.push.apply(that.list, res.data);
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,316 @@
|
||||
<template>
|
||||
<view class="newsList" ref="container">
|
||||
<mescroll-body ref="mescrollRef" top="0" bottom="0" class='cotent-scroll' :up="upOption" :down="downOption" @up="upCallback" @down="downCallback" @init="mescrollInit" @emptyclick="emptyClick">
|
||||
|
||||
<view class="list" v-for="(item, index) in list" :key="index">
|
||||
<view @click="goNewsDetail(item)" class="item acea-row" style="flex-wrap: nowrap;">
|
||||
<view class="text acea-row row-column-between">
|
||||
<view class="acea-row row-column" style="position: relative;">
|
||||
<view class="name line2">{{ item.name }}</view>
|
||||
<view class="summary line1" style="width: 322rpx;">{{ shortDateString(item.createdTime) }}</view>
|
||||
|
||||
</view>
|
||||
<view class="acea-row row-left row-middle">
|
||||
<view class="see-num-box acea-row row-middle" style="margin-right: 20rpx;">
|
||||
<image :src="webUrl+'/20230304131559277594.png'" class="eye-icon" mode=""></image>
|
||||
<text class="see-num-text">{{item.pv||0}}</text>
|
||||
</view>
|
||||
<view class="zan-num-box acea-row row-middle">
|
||||
<img class="zan-icon" :src="webUrl+'/20230304133322439350.png'" />
|
||||
<text class="zan-num-text">{{item.zan||0}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pictrue">
|
||||
|
||||
<image v-if="item.type=='NT_TEXT'" style="width: 100%;height: 100%;" :src="item.resources[0]" />
|
||||
<video v-if="item.type=='NT_VIDEO'" style="width: 100%;height: 100%;" :src="item.resources[0]"></video>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view id="loading-more"></view>
|
||||
</mescroll-body>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import MescrollMixins from "@/mixins/mescroll-mixins.js";
|
||||
import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue";
|
||||
import { getHotelNewsZanList } from "@/api/inn.js";
|
||||
import { formatDateTime,isNullOrEmpty} from "@/utils";
|
||||
var _this;
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
list:[],
|
||||
upOption:{
|
||||
noMoreSize: 10, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
|
||||
auto:true,
|
||||
empty:{
|
||||
tip: '暂无数据' // 提示
|
||||
// btnText:'点击刷新'
|
||||
}
|
||||
},
|
||||
downOption:{
|
||||
auto:false
|
||||
}
|
||||
}
|
||||
},
|
||||
components:{
|
||||
MescrollBody
|
||||
},
|
||||
mixins:[
|
||||
MescrollMixins({
|
||||
getPageData(mescroll){
|
||||
var _this = this;
|
||||
// 此时mescroll会携带page的参数:
|
||||
let pageNum = mescroll.num; // 页码, 默认从1开始
|
||||
let pageSize = mescroll.size; // 页长, 默认每页10条
|
||||
var params = {
|
||||
limit:pageNum,
|
||||
page:pageSize
|
||||
}
|
||||
getHotelNewsZanList(params)
|
||||
.then(res => {
|
||||
|
||||
|
||||
if(mescroll.num == 1) {
|
||||
_this.list = []; //如果是第一页需手动制空列表
|
||||
}
|
||||
_this.list = _this.list.concat(res.data);//追加新数据
|
||||
mescroll.endSuccess(res.data.length);
|
||||
})
|
||||
.catch(err => {
|
||||
|
||||
console.log(err);
|
||||
mescroll.endErr();
|
||||
uni.showToast({
|
||||
title: err.msg || '请求出错',
|
||||
icon: 'none',
|
||||
mask: false,
|
||||
duration: 1500
|
||||
});
|
||||
})
|
||||
}
|
||||
})
|
||||
],
|
||||
onLoad:function(e){
|
||||
_this = this;
|
||||
//从query里取模式
|
||||
//this.isSelectMode = this.$yroute.query.isSelected;
|
||||
},
|
||||
onShow:function(){
|
||||
//静默刷新
|
||||
this.mescroll && this.mescroll.resetUpScroll(false);
|
||||
},
|
||||
methods: {
|
||||
isNullOrEmpty,
|
||||
shortDateString(dateStr){
|
||||
var ret = '';
|
||||
if (isNullOrEmpty(dateStr)) {
|
||||
|
||||
} else{
|
||||
// var s = dataStr;
|
||||
// s = s.replace(/-/g,"/");
|
||||
// var date = new Date(s).getTime();
|
||||
ret = formatDateTime(dateStr,'yyyy-MM-dd HH:mm:ss');
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
goNewsDetail:function(item){
|
||||
this.$yrouter.push('/pagesInn/inn/innInfoDetail?id='+item.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
|
||||
.pink-dot{
|
||||
width:24rpx;
|
||||
height:24rpx;
|
||||
background:rgba(255,86,74,0.4);
|
||||
border-radius:50%;
|
||||
position: absolute;
|
||||
z-index: 0;
|
||||
bottom: 0;
|
||||
right: -12rpx;
|
||||
}
|
||||
.main-title{
|
||||
font-size: 36rpx;
|
||||
line-height: 36rpx;
|
||||
// color: #080F1A;
|
||||
color: #FFFFFF;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.eye-icon{
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
|
||||
.zan-icon{
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
.zan-num-text{
|
||||
color: #080F1A;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.see-num-text{
|
||||
color: #080F1A;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.newsList .list .item .text .name{
|
||||
color: #080F1A !important;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.newsList .list .item .text{
|
||||
margin-right: 10rpx;
|
||||
width: auto !important;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
.newsList .list .item .pictrue{
|
||||
flex-shrink: 0;
|
||||
width: 288rpx !important;
|
||||
height: 216rpx !important;
|
||||
}
|
||||
|
||||
.newsList .list .item{
|
||||
background-color: #fff;
|
||||
flex-wrap: nowrap;
|
||||
padding: 35rpx !important;
|
||||
margin: 35rpx 30rpx !important;
|
||||
border-radius: 8rpx;
|
||||
|
||||
}
|
||||
|
||||
.summary{
|
||||
color: #C2C5CC;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.sub-title{
|
||||
font-size:14*2rpx;
|
||||
margin-top: 10rpx;
|
||||
color:rgba(252,85,179,0.7);
|
||||
}
|
||||
|
||||
.title .hot-title{
|
||||
font-size: 18*2rpx;
|
||||
color: #FF7900;
|
||||
background:rgba(255,255,255,1);
|
||||
margin-left: 5*2rpx;
|
||||
margin-right: 5*2rpx;
|
||||
}
|
||||
|
||||
.hotGoodsList{
|
||||
position: relative;
|
||||
margin: 35rpx 0;
|
||||
background-color: #fff;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.hotGoodsList .newProductsItem{
|
||||
margin-left: 35rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.img-box{
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.price-tag{
|
||||
position: absolute;
|
||||
width: 39*2rpx;
|
||||
height: 19*2rpx;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.like-btn{
|
||||
position: absolute;
|
||||
width: 24*2rpx;
|
||||
height: 24*2rpx;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.inn-tag-wrap{
|
||||
margin-top: 10rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.zanmost-tag{
|
||||
padding: 2rpx 8rpx 2rpx 8rpx;
|
||||
background: #FF2D69;
|
||||
font-size: 10*2rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.latest-tag{
|
||||
padding: 2rpx 8rpx 2rpx 8rpx;
|
||||
background: #0DC5C5;
|
||||
font-size: 10*2rpx;
|
||||
color: #FFFFFF;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
|
||||
.location-tag{
|
||||
padding: 2rpx 8rpx 2rpx 8rpx;
|
||||
background: #FD685D;
|
||||
font-size: 10*2rpx;
|
||||
color: #FFFFFF;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
|
||||
.inn-shop-icon{
|
||||
border-radius: 50%;
|
||||
width: 24*2rpx;
|
||||
height: 24*2rpx;
|
||||
}
|
||||
|
||||
.inn-shop-name{
|
||||
font-size: 24rpx;
|
||||
color: #080F1A;
|
||||
}
|
||||
|
||||
.inn-shop-date{
|
||||
font-size: 18rpx;
|
||||
color: #C2C5CC;
|
||||
}
|
||||
|
||||
.location{
|
||||
padding: 4rpx 16rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 22rpx;
|
||||
}
|
||||
|
||||
.city-name{
|
||||
color: #FD685D;
|
||||
font-size: 24rpx;
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
|
||||
.btLine{
|
||||
width: 100%;
|
||||
height: 12rpx;
|
||||
margin-top: -4rpx;
|
||||
background: #FD685D;
|
||||
}
|
||||
|
||||
.pro-info{
|
||||
font-size: 14*2rpx;
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,209 @@
|
||||
<template>
|
||||
<view class="member-center">
|
||||
<view class="header">
|
||||
<view class="slider-banner banner">
|
||||
<swiper indicatorDots="true" @change="swiperChange">
|
||||
<block v-for="(item, vipListIndex) in vipList" :key="vipListIndex">
|
||||
<swiper-item>
|
||||
<view class="swiper-slide" :style="{ backgroundImage: 'url(' + item.image + ')' }">
|
||||
<!-- <image :src="item.icon" />-->
|
||||
<view class="name">{{ item.name }}</view>
|
||||
<view class="discount">
|
||||
可享受商品折扣: {{ item.discount / 10 }}折
|
||||
<text class="iconfont icon-zhekou"></text>
|
||||
</view>
|
||||
<view class="nav acea-row" v-if="item.grade == grade">
|
||||
<view class="item" v-for="(val, indexn) in vipComplete" :key="indexn">
|
||||
<view class="num">{{ val.newNumber }}</view>
|
||||
<view>{{ val.realName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="lock" v-if="item.grade > grade">
|
||||
<text class="iconfont icon-quanxianguanlisuozi"></text>该会员等级尚未解锁
|
||||
</view>
|
||||
<view class="lock" v-if="item.grade < grade">
|
||||
<text class="iconfont icon-xuanzhong1"></text>已解锁更高等级
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
<view class="title acea-row row-between-wrapper">
|
||||
<view>
|
||||
<text class="iconfont icon-jingyanzhi"></text>会员升级要求
|
||||
</view>
|
||||
<view class="num">
|
||||
<text class="current">{{ taskCount }}</text>
|
||||
/{{ vipRequire.length }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item" v-for="(item, vipCompleteIndex) in vipComplete" :key="vipCompleteIndex">
|
||||
<view class="top acea-row row-between-wrapper">
|
||||
<view class="name">
|
||||
{{ item.name}}
|
||||
<text class="iconfont icon-wenti" v-if="item.illustrate" @click="showGrow(item)"></text>
|
||||
</view>
|
||||
<view>{{ item.finish ? "已满足条件" : "未满足条件" }}</view>
|
||||
</view>
|
||||
<view class="cu-progress">
|
||||
<view class="bg-red" :style="{ width: item.speed + '%' }"></view>
|
||||
</view>
|
||||
<view class="experience acea-row row-between-wrapper">
|
||||
<view>{{ item.taskTypeTitle }}</view>
|
||||
<view>
|
||||
<text class="num">{{ item.newNumber }}</text>
|
||||
/{{ item.number }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<Recommend></Recommend>
|
||||
<view class="growthValue" :class="growthValue === false ? 'on' : ''">
|
||||
<view class="pictrue">
|
||||
<image :src="webUrl+'/20200729164901293388.jpg'" />
|
||||
<text class="iconfont icon-guanbi3" @click="growthTap"></text>
|
||||
</view>
|
||||
<view class="conter">{{ illustrate }}</view>
|
||||
</view>
|
||||
<view class="mask" :hidden="growthValue" @click="growthTap"></view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
// import { swiper, swiperSlide } from "vue-awesome-swiper";
|
||||
|
||||
import Recommend from "@/components/Recommend";
|
||||
import { getVipInfo, getVipTask, setDetection } from "@/api/user";
|
||||
export default {
|
||||
name: "Poster",
|
||||
components: {
|
||||
// swiper,
|
||||
// swiperSlide,
|
||||
Recommend
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
webUrl:this.$VUE_APP_RESOURCES_URL,
|
||||
vipList: [], //等级列表
|
||||
vipRequire: [], //等级要求
|
||||
vipComplete: [], //完成情况
|
||||
taskCount: 0, //任务数
|
||||
grade: 0, //当前会员等级
|
||||
swiperVip: {
|
||||
speed: 1000,
|
||||
effect: "coverflow",
|
||||
slidesPerView: "auto",
|
||||
centeredSlides: true,
|
||||
// loop: true,
|
||||
coverflowEffect: {
|
||||
rotate: 0, // 旋转的角度
|
||||
stretch: -20, // 拉伸 图片间左右的间距和密集度
|
||||
depth: 100, // 深度 切换图片间上下的间距和密集度
|
||||
modifier: 2, // 修正值 该值越大前面的效果越明显
|
||||
slideShadows: false // 页面阴影效果
|
||||
},
|
||||
observer: true,
|
||||
observeParents: true
|
||||
},
|
||||
loading: false,
|
||||
growthValue: true,
|
||||
illustrate: "",
|
||||
activeIndex: 0
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
vipList: function() {
|
||||
let that = this;
|
||||
if (that.vipList.length > 0) {
|
||||
that.vipList.forEach(function(item, index) {
|
||||
if (item.isClear === false) {
|
||||
// that.swiper.slideTo(index);
|
||||
that.activeIndex = index;
|
||||
that.grade = item.grade;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
swiper() {
|
||||
// return this.$refs.mySwiper.swiper;
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
let that = this;
|
||||
setDetection();
|
||||
that.getInfo();
|
||||
// that.swiper.on("slideChange", function() {
|
||||
// that.activeIndex = that.swiper.activeIndex;
|
||||
// that.getTask();
|
||||
// });
|
||||
},
|
||||
|
||||
methods: {
|
||||
swiperChange: function(e) {
|
||||
let that = this;
|
||||
that.activeIndex = e.mp.detail.current;
|
||||
that.getTask();
|
||||
},
|
||||
growthTap: function() {
|
||||
this.growthValue = true;
|
||||
},
|
||||
getInfo: function() {
|
||||
let that = this;
|
||||
getVipInfo().then(
|
||||
res => {
|
||||
that.vipList = res.data.list;
|
||||
that.vipRequire = res.data.task.list;
|
||||
that.vipComplete = res.data.task.task;
|
||||
that.taskCount = res.data.task.reachCount;
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title:
|
||||
err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
getTask: function() {
|
||||
let that = this;
|
||||
getVipTask(that.vipList[that.activeIndex].id).then(
|
||||
res => {
|
||||
that.vipRequire = res.data.list;
|
||||
that.vipComplete = res.data.task;
|
||||
that.taskCount = res.data.reach_count;
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title:
|
||||
err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
showGrow: function(item) {
|
||||
if (this.illustrate != item.illustrate) this.illustrate = item.illustrate;
|
||||
this.growthValue = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.banner swiper {
|
||||
height: 328rpx;
|
||||
}
|
||||
.swiper-slide {
|
||||
margin: 0 auto;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,375 @@
|
||||
<template>
|
||||
<view class="addAddress absolute">
|
||||
<view class="list">
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view class="name">姓名</view>
|
||||
<input type="text" placeholder="请输入姓名" v-model="userAddress.realName" required/>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view class="name">联系电话</view>
|
||||
<input type="text" placeholder="请输入联系电话" v-model="userAddress.phone" required :maxlength="11"/>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view class="name">所在地区</view>
|
||||
<view class="picker acea-row row-between-wrapper select-value form-control">
|
||||
<view class="address">
|
||||
<CitySelect
|
||||
ref="cityselect"
|
||||
:defaultValue="addressText"
|
||||
@callback="result"
|
||||
:items="district"
|
||||
></CitySelect>
|
||||
</view>
|
||||
<view class="iconfont icon-dizhi font-color-red" @click="getCurAddress()"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper" style="flex-wrap: nowrap;">
|
||||
<view class="name">详细地址</view>
|
||||
<input type="text" placeholder="请填写具体地址" v-model="userAddress.detail" required/>
|
||||
<!-- <textarea v-model="userAddress.detail" placeholder="请填写具体地址" /> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="default acea-row row-middle">
|
||||
<view class="select-btn">
|
||||
<view class="checkbox-wrapper">
|
||||
<checkbox-group @change="ChangeIsDefault">
|
||||
<label class="well-check">
|
||||
<checkbox :checked="userAddress.isDefault ? true : false"></checkbox>
|
||||
<text class="def">设置为默认地址</text>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view></view>
|
||||
<view class="keepBnt bg-color-red" @tap="submit">立即保存</view>
|
||||
<view class="wechatAddress" v-if="isWechat && !id" @click="getAddress">导入微信地址</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script type="text/babel">
|
||||
import CitySelect from "@/components/CitySelect";
|
||||
import config from '@/utils/mapConfig';
|
||||
import {getAddress, getCity, postAddress} from "@/api/user";
|
||||
import attrs, {chs_extphone, required} from "@/utils/validate";
|
||||
import {validatorDefaultCatch} from "@/utils/dialog";
|
||||
// import { openAddress } from "@/libs/wechat";
|
||||
import {isWeixin} from "@/utils";
|
||||
|
||||
export default {
|
||||
name: "AddAddress",
|
||||
components: {
|
||||
CitySelect
|
||||
},
|
||||
computed: {},
|
||||
data() {
|
||||
return {
|
||||
district: [],
|
||||
id: 0,
|
||||
userAddress: {isDefault: 0},
|
||||
address: {},
|
||||
isWechat: isWeixin(),
|
||||
addressText: ""
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
let id = this.$yroute.query.id;
|
||||
this.id = id;
|
||||
if (this.id) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '编辑地址'
|
||||
})
|
||||
}
|
||||
this.getUserAddress();
|
||||
this.getCityList();
|
||||
},
|
||||
watch: {
|
||||
// addressText(nextModel2) {
|
||||
// console.log(nextModel2, 8585858585);
|
||||
// }
|
||||
//定位成功后回调
|
||||
// province(newVal,oldVal){
|
||||
// uni.hideLoading();
|
||||
// //if(newVal!=oldVal){
|
||||
|
||||
// this.addressText =
|
||||
// this.province + " " + this.city + " " + this.county;
|
||||
// this.address.province = this.province;
|
||||
// this.address.city = this.city;
|
||||
// this.address.district = this.county;
|
||||
// this.userAddress.detail = this.detailAddress;
|
||||
|
||||
// //}
|
||||
// }
|
||||
},
|
||||
methods: {
|
||||
|
||||
getIndex(value, arr) {
|
||||
var idx = -1;
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
if (arr[i].n == value) {
|
||||
idx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return idx;
|
||||
},
|
||||
//获取当前定位地址
|
||||
getCurAddress() {
|
||||
|
||||
var that = this;
|
||||
//定位
|
||||
uni.showLoading({
|
||||
title: '定位中...'
|
||||
});
|
||||
|
||||
//this.getLocation();
|
||||
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
success: function (res) {
|
||||
let latitude = res.latitude;
|
||||
let longitude = res.longitude;
|
||||
|
||||
console.log('latitude:' + latitude + 'longitude:' + longitude)
|
||||
|
||||
// #ifdef H5
|
||||
Vue.jsonp(
|
||||
'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' + longitude + '&key=' + config.key,
|
||||
{
|
||||
//callbackName: 'QQmap',
|
||||
output: 'jsonp',
|
||||
}).then(json => {
|
||||
// Success.
|
||||
uni.hideLoading();
|
||||
|
||||
that.addressText =
|
||||
json.result.ad_info.province + " " + json.result.ad_info.city + " " + json.result.ad_info.district;
|
||||
that.address.province = json.result.ad_info.province;
|
||||
that.address.city = json.result.ad_info.city;
|
||||
that.address.district = json.result.ad_info.district;
|
||||
that.$set(that.userAddress, 'detail', json.result.formatted_addresses.recommend);
|
||||
//that.userAddress.detail = json.result.formatted_addresses.recommend;
|
||||
// that.$refs.cityselect.adjustDefaultValue();
|
||||
|
||||
//设置city_id
|
||||
var pIdx = that.getIndex(that.address.province, that.district);
|
||||
if (pIdx > -1) {
|
||||
var citys = that.district[pIdx].c;
|
||||
var cIdx = that.getIndex(that.address.city, citys);
|
||||
if (cIdx > -1) {
|
||||
var city = citys[cIdx];
|
||||
that.address.city_id = city.v;
|
||||
console.log('city_id:' + city.v);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}).catch(err => {
|
||||
// Failed.
|
||||
console.log('地址解析失败:' + JSON.stringify(err));
|
||||
uni.hideLoading();
|
||||
})
|
||||
// #endif
|
||||
|
||||
// #ifndef H5
|
||||
uni.request({
|
||||
url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' + longitude + '&key=' + config.key,
|
||||
success: function (res) {
|
||||
// console.log('res:'+JSON.stringify(res.data));
|
||||
uni.hideLoading();
|
||||
that.addressText =
|
||||
res.data.result.ad_info.province + " " + res.data.result.ad_info.city + " " + res.data.result.ad_info.district;
|
||||
that.address.province = res.data.result.ad_info.province;
|
||||
that.address.city = res.data.result.ad_info.city;
|
||||
that.address.district = res.data.result.ad_info.district;
|
||||
//that.userAddress.detail = res.data.result.formatted_addresses.recommend;
|
||||
that.$set(that.userAddress, 'detail', res.data.result.formatted_addresses.recommend);
|
||||
// that.$refs.cityselect.adjustDefaultValue();
|
||||
//设置city_id
|
||||
var pIdx = that.getIndex(that.address.province, that.district);
|
||||
if (pIdx > -1) {
|
||||
var citys = that.district[pIdx].c;
|
||||
var cIdx = that.getIndex(that.address.city, citys);
|
||||
if (cIdx > -1) {
|
||||
var city = citys[cIdx];
|
||||
that.address.city_id = city.v;
|
||||
console.log('city_id:' + city.v);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
fail: function (res) {
|
||||
console.log('地址解析失败');
|
||||
uni.hideLoading();
|
||||
},
|
||||
complete: function () {
|
||||
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
fail: function (res) {
|
||||
uni.hideLoading();
|
||||
|
||||
// uni.showToast({
|
||||
// title:'城市定位失败:'+JSON.stringify(res),
|
||||
// icon:'none',
|
||||
// duration:2000
|
||||
// })
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
getCityList: function () {
|
||||
let that = this;
|
||||
getCity()
|
||||
.then(res => {
|
||||
that.district = res.data;
|
||||
that.ready = true;
|
||||
|
||||
if (this.id) {
|
||||
//设置city_id
|
||||
var pIdx = that.getIndex(that.address.province, that.district);
|
||||
if (pIdx > -1) {
|
||||
var citys = that.district[pIdx].c;
|
||||
var cIdx = that.getIndex(that.address.city, citys);
|
||||
if (cIdx > -1) {
|
||||
var city = citys[cIdx];
|
||||
that.address.city_id = city.v;
|
||||
console.log('city_id:' + city.v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
.catch(err => {
|
||||
that.$dialog.error(err.msg);
|
||||
});
|
||||
},
|
||||
getUserAddress: function () {
|
||||
if (!this.id) return false;
|
||||
let that = this;
|
||||
getAddress(that.id).then(res => {
|
||||
that.userAddress = res.data;
|
||||
that.addressText =
|
||||
res.data.province + " " + res.data.city + " " + res.data.district;
|
||||
that.address.province = res.data.province;
|
||||
that.address.city = res.data.city;
|
||||
that.address.district = res.data.district;
|
||||
|
||||
if (that.district.length > 0) {
|
||||
//设置city_id
|
||||
var pIdx = that.getIndex(that.address.province, that.district);
|
||||
if (pIdx > -1) {
|
||||
var citys = that.district[pIdx].c;
|
||||
var cIdx = that.getIndex(that.address.city, citys);
|
||||
if (cIdx > -1) {
|
||||
var city = citys[cIdx];
|
||||
that.address.city_id = city.v;
|
||||
console.log('city_id:' + city.v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
getAddress() {
|
||||
},
|
||||
async submit() {
|
||||
let name = this.userAddress.realName,
|
||||
phone = this.userAddress.phone,
|
||||
addressText = this.addressText,
|
||||
detail = this.userAddress.detail,
|
||||
isDefault = this.userAddress.isDefault;
|
||||
|
||||
if (phone.length < 11) {
|
||||
uni.showToast({
|
||||
title: "请输入11位手机号码",
|
||||
icon: "none"
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await this.$validator({
|
||||
name: [
|
||||
required(required.message("姓名")),
|
||||
attrs.range([2, 16], attrs.range.message("姓名"))
|
||||
],
|
||||
phone: [
|
||||
required(required.message("联系电话")),
|
||||
chs_extphone(chs_extphone.message())
|
||||
//chs_phone(chs_phone.message())
|
||||
],
|
||||
addressText: [required("请选择地址")],
|
||||
detail: [required(required.message("具体地址"))]
|
||||
}).validate({name, phone, addressText, detail});
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
try {
|
||||
let that = this,
|
||||
data = {
|
||||
id: that.id,
|
||||
real_name: name,
|
||||
phone: phone,
|
||||
address: this.address,
|
||||
detail: detail,
|
||||
is_default: isDefault ? true : false,
|
||||
post_code: ""
|
||||
};
|
||||
postAddress(data).then(function () {
|
||||
if (that.id) {
|
||||
uni.showToast({
|
||||
title: "修改成功",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "已取消绑定",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
that.$yrouter.back();
|
||||
});
|
||||
} catch (err) {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
},
|
||||
ChangeIsDefault: function () {
|
||||
this.userAddress.isDefault = !this.userAddress.isDefault;
|
||||
},
|
||||
result(values) {
|
||||
console.log(this);
|
||||
console.log(values);
|
||||
this.address = {
|
||||
province: values.province.name || "",
|
||||
city: values.city.name || "",
|
||||
district: values.district.name || "",
|
||||
city_id: values.city.id
|
||||
};
|
||||
this.addressText = `${this.address.province} ${this.address.city} ${this.address.district}`;
|
||||
// this.addressText =
|
||||
// this.address.province + this.address.city + this.address.district;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.address {
|
||||
text {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,273 @@
|
||||
<template>
|
||||
<view
|
||||
class="address-management"
|
||||
:class="addressList.length < 1 && page > 1 ? 'on' : ''"
|
||||
ref="container"
|
||||
|
||||
>
|
||||
<view style="margin-bottom: 12rpx;" class="line" v-if="addressList.length > 0">
|
||||
<image :src="webUrl+'/20230304135025917856.png'"/>
|
||||
</view>
|
||||
<view style="position: relative;" class="item" v-for="(item, addressListIndex) in addressList"
|
||||
:key="addressListIndex" @click="tapAddress(item)">
|
||||
<view v-if="item.isDefault||item.isDefault=='1' ? true : false" class=""
|
||||
style="position: absolute;top: 0;right: 0;">
|
||||
<image style="width: 72rpx;height: 36rpx;" :src="webUrl+'/20210807165228290910.png'" mode=""></image>
|
||||
</view>
|
||||
<view class="address">
|
||||
<view class="consignee">
|
||||
收货人:{{ item.realName }}
|
||||
<text class="phone">{{ item.phone }}</text>
|
||||
</view>
|
||||
<view style="color: #8B8F99;">
|
||||
收货地址:{{ item.province }}{{ item.city }}{{
|
||||
item.district
|
||||
}}{{ item.detail }}
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="!chooseMode" class="operation acea-row row-between-wrapper">
|
||||
<view class="select-btn">
|
||||
<view class="checkbox-wrapper">
|
||||
<checkbox-group @change.stop="radioChange(item.id)">
|
||||
<label class="well-check acea-row row-middle">
|
||||
<checkbox style="transform: scale(0.55);"
|
||||
:checked="item.isDefault||item.isDefault=='1' ? true : false"></checkbox>
|
||||
<text class="default" style="margin-left: -10rpx;">设为默认</text>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="acea-row row-middle">
|
||||
<view @click.stop="editAddress(addressListIndex)" style="color: #B3BCBF;">
|
||||
<text class="iconfont icon-bianji" style="color: #B3BCBF;"></text>
|
||||
<text>修改</text>
|
||||
</view>
|
||||
<view @click.stop="delAddress(addressListIndex)" style="color: #B3BCBF;">
|
||||
<text class="iconfont icon-shanchu" style="color: #B3BCBF;"></text>
|
||||
<text>删除</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<Loading :loaded="loadend" :loading="loading"></Loading>
|
||||
<view class="noCommodity" v-if="addressList.length < 1 && page > 1">
|
||||
<view class="noPictrue">
|
||||
<image :src="webUrl+'/20210203154438492268.png'" class="image"/>
|
||||
</view>
|
||||
</view>
|
||||
<view style="height:100rpx;"></view>
|
||||
<view class="footer acea-row row-between-wrapper">
|
||||
<view class="addressBnt bg-color-lightred" v-if="isWechat" @click="addAddress">
|
||||
<text class="iconfont icon-tianjiadizhi"></text>
|
||||
添加新地址
|
||||
</view>
|
||||
<view class="addressBnt on bg-color-lightred" v-else @click="addAddress">
|
||||
<text class="iconfont icon-tianjiadizhi"></text>
|
||||
添加新地址
|
||||
</view>
|
||||
<!--<view class="addressBnt wxbnt" v-if="isWechat" @click="getAddress">-->
|
||||
<!--<text class="iconfont icon-weixin2"></text>导入微信地址-->
|
||||
<!--</view>-->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<style scoped lang="less">
|
||||
.address-management.on {
|
||||
background-color: #fff;
|
||||
height: 100vh;
|
||||
}
|
||||
</style>
|
||||
<script type="text/babel">
|
||||
import {getAddressDefaultSet, getAddressList, getAddressRemove} from "@/api/user";
|
||||
import Loading from "@/components/Loading";
|
||||
import {isWeixin} from "@/utils";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Loading
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||
page: 1,
|
||||
limit: 20,
|
||||
chooseMode: false,//是否选择地址模式
|
||||
addressList: [],
|
||||
loadTitle: "",
|
||||
loading: false,
|
||||
loadend: false,
|
||||
isWechat: isWeixin()
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
this.AddressList();
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loading && this.AddressList();
|
||||
},
|
||||
onLoad: function (e) {
|
||||
//是否选择模式
|
||||
if (this.$yroute.query.choosMode != undefined) {
|
||||
this.chooseMode = true;
|
||||
uni.setNavigationBarTitle({
|
||||
title: '选择收货地址'
|
||||
})
|
||||
} else {
|
||||
this.chooseMode = false;
|
||||
}
|
||||
},
|
||||
onShow: function () {
|
||||
this.refresh();
|
||||
},
|
||||
methods: {
|
||||
tapAddress: function (item) {
|
||||
if (this.chooseMode) {
|
||||
//通知前一界面修改地址
|
||||
uni.$emit('chooseAddress', item)
|
||||
//关闭当前页面
|
||||
this.$yrouter.back();
|
||||
|
||||
}
|
||||
},
|
||||
refresh: function () {
|
||||
this.addressList = [];
|
||||
this.page = 1;
|
||||
this.loadend = false;
|
||||
this.AddressList();
|
||||
},
|
||||
/**
|
||||
* 获取地址列表
|
||||
*
|
||||
*/
|
||||
AddressList: function () {
|
||||
let that = this;
|
||||
if (that.loading) return; //阻止下次请求(false可以进行请求);
|
||||
if (that.loadend) return; //阻止结束当前请求(false可以进行请求);
|
||||
that.loading = true;
|
||||
getAddressList({page: that.page, limit: that.limit}).then(res => {
|
||||
that.loading = false;
|
||||
//apply();js将一个数组插入另一个数组;
|
||||
that.addressList.push.apply(that.addressList, res.data);
|
||||
that.loadend = res.data.length < that.limit; //判断所有数据是否加载完成;
|
||||
that.page = that.page + 1;
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 编辑地址
|
||||
*/
|
||||
editAddress: function (index) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/user/address/AddAddress/index",
|
||||
query: {id: this.addressList[index].id}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 删除地址
|
||||
*/
|
||||
delAddress: function (index) {
|
||||
let that = this;
|
||||
let address = this.addressList[index];
|
||||
let id = address.id;
|
||||
|
||||
uni.showModal({
|
||||
title: '确认删除此收货地址?',
|
||||
content: '',
|
||||
showCancel: true,
|
||||
cancelText: '取消',
|
||||
confirmText: '确认',
|
||||
success: res => {
|
||||
|
||||
if (res.confirm) {
|
||||
getAddressRemove(id).then(function () {
|
||||
uni.showToast({
|
||||
title: "删除成功!",
|
||||
icon: "success",
|
||||
duration: 2000,
|
||||
complete: () => {
|
||||
that.addressList.splice(index, 1);
|
||||
that.$set(that, "addressList", that.addressList);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
fail: () => {
|
||||
},
|
||||
complete: () => {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
/**
|
||||
* 设置默认地址
|
||||
*/
|
||||
radioChange: function (id) {
|
||||
getAddressDefaultSet(id).then(res => {
|
||||
this.refresh();
|
||||
uni.showToast({title: res.msg, icon: "none", duration: 2000});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 新增地址
|
||||
*/
|
||||
addAddress: function () {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/user/address/AddAddress/index"
|
||||
});
|
||||
},
|
||||
getAddress() {
|
||||
// openAddress().then(userInfo => {
|
||||
// uni.showLoading({ title: "加载中" });
|
||||
// postAddress({
|
||||
// real_name: userInfo.userName,
|
||||
// phone: userInfo.telNumber,
|
||||
// address: {
|
||||
// province: userInfo.provinceName,
|
||||
// city: userInfo.cityName,
|
||||
// district: userInfo.countryName
|
||||
// },
|
||||
// detail: userInfo.detailInfo,
|
||||
// post_code: userInfo.postalCode,
|
||||
// wx_export: 1
|
||||
// })
|
||||
// .then(() => {
|
||||
// this.page = 1;
|
||||
// this.loading = false;
|
||||
// this.loadend = false;
|
||||
// this.addressList = [];
|
||||
// this.AddressList();
|
||||
// uni.hideLoading();
|
||||
// uni.showToast({
|
||||
// title: "添加成功",
|
||||
// icon: 'success',
|
||||
// duration: 2000
|
||||
// });
|
||||
// })
|
||||
// .catch(err => {
|
||||
// uni.hideLoading();
|
||||
// uni.showToast({
|
||||
// title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
// icon: 'none',
|
||||
// duration: 2000
|
||||
// });
|
||||
// });
|
||||
// });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
|
||||
.address-management .item {
|
||||
box-shadow: 0px 6rpx 6rpx rgba(0, 0, 0, 0.1);
|
||||
opacity: 1;
|
||||
border-radius: 16rpx;
|
||||
margin-left: 32rpx;
|
||||
margin-right: 32rpx;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,107 @@
|
||||
<template>
|
||||
<view ref="container">
|
||||
<div class="coupon-list" v-if="couponsList.length > 0">
|
||||
<div
|
||||
class="item acea-row row-center-wrapper"
|
||||
v-for="(item, index) in couponsList"
|
||||
:key="index"
|
||||
>
|
||||
<div class="money" :class="item.isUse ? 'moneyGray' : ''">
|
||||
<div>
|
||||
¥
|
||||
<span class="num">{{ item.couponPrice }}</span>
|
||||
</div>
|
||||
<div class="pic-num">满{{ item.useMinPrice }}元可用</div>
|
||||
</div>
|
||||
<div class="text">
|
||||
<div class="condition line1">
|
||||
<span class="line-title bg-color-check" v-if="item.ctype === 0">通用劵</span>
|
||||
<span class="line-title bg-color-check" v-else-if="item.ctype === 1">商品券</span>
|
||||
<span class="line-title bg-color-check" v-else>未知</span>
|
||||
<span>{{ item.cname }}</span>
|
||||
</div>
|
||||
<div class="data acea-row row-between-wrapper">
|
||||
<div v-if="item.endTime !== 0">{{ item.startTime }}-{{ item.endTime }}</div>
|
||||
<div v-else>不限时</div>
|
||||
<div class="bnt gray" v-if="item.isUse === true">已领取</div>
|
||||
<div class="bnt gray" v-else-if="item.isUse === 2">已领完</div>
|
||||
<div class="bnt bg-color-red" v-else @click="getCoupon(item.id, index)">立即领取</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Loading :loaded="loadend" :loading="loading"></Loading>
|
||||
<!--暂无优惠券-->
|
||||
<view class="noCommodity" v-if="couponsList.length === 0 && page > 1">
|
||||
<view class="noPictrue">
|
||||
<image src="http://admin-api.xdd618.com/file/pic/20210203154207179472.png" class="image" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getCoupon, getCouponReceive } from "@/api/user";
|
||||
import Loading from "@/components/Loading";
|
||||
import DataFormatT from "@/components/DataFormatT";
|
||||
export default {
|
||||
name: "getCoupon",
|
||||
components: {
|
||||
Loading,
|
||||
DataFormatT
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
couponsList: [],
|
||||
loading: false,
|
||||
loadend: false
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getUseCoupons();
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loading && this.getUseCoupons();
|
||||
},
|
||||
methods: {
|
||||
getCoupon: function(id, index) {
|
||||
let that = this;
|
||||
let list = that.couponsList;
|
||||
getCouponReceive(id)
|
||||
.then(function(res) {
|
||||
list[index].isUse = true;
|
||||
uni.showToast({
|
||||
title: "领取成功",
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
.catch(function(err) {
|
||||
uni.showToast({
|
||||
title:
|
||||
err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
getUseCoupons: function() {
|
||||
let that = this;
|
||||
if (that.loading) return; //阻止下次请求(false可以进行请求);
|
||||
if (that.loadend) return; //阻止结束当前请求(false可以进行请求);
|
||||
that.loading = true;
|
||||
let q = { page: that.page, limit: that.limit };
|
||||
getCoupon(q).then(res => {
|
||||
that.loading = false;
|
||||
//apply();js将一个数组插入另一个数组;
|
||||
that.couponsList.push.apply(that.couponsList, res.data);
|
||||
that.loadend = res.data.length < that.limit; //判断所有数据是否加载完成;
|
||||
that.page = that.page + 1;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,79 @@
|
||||
<template>
|
||||
<view ref="container">
|
||||
<div class="coupon-list" v-if="couponsList.length > 0">
|
||||
<div
|
||||
class="item acea-row row-center-wrapper"
|
||||
v-for="(item, index) in couponsList"
|
||||
:key="index"
|
||||
>
|
||||
<div class="money" :class="item._type === 0 ? 'moneyGray' : ''">
|
||||
<div>
|
||||
¥<span class="num">{{ item.couponPrice }}</span>
|
||||
</div>
|
||||
<div class="pic-num">满{{ item.useMinPrice }}元可用</div>
|
||||
</div>
|
||||
<div class="text">
|
||||
<div class="condition line1">
|
||||
{{ item.couponTitle }}
|
||||
</div>
|
||||
<div class="data acea-row row-between-wrapper">
|
||||
<div v-if="item.endTime === 0">不限时</div>
|
||||
<div v-else>{{ item.createTime }}-{{ item.endTime }}</div>
|
||||
<div class="bnt gray" v-if="item._type === 0">{{ item._msg }}</div>
|
||||
<div class="bnt bg-color-red" v-else>{{ item._msg }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--暂无优惠券-->
|
||||
<view
|
||||
class="noCommodity"
|
||||
v-if="couponsList.length === 0 && loading === true"
|
||||
>
|
||||
<view class="noPictrue">
|
||||
<image src="http://admin-api.xdd618.com/file/pic/20210203154207179472.png" class="image"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import {getCouponsUser} from "@/api/user";
|
||||
import DataFormatT from "@/components/DataFormatT";
|
||||
|
||||
const NAME = "UserCoupon";
|
||||
|
||||
export default {
|
||||
name: "UserCoupon",
|
||||
components: {
|
||||
DataFormatT
|
||||
},
|
||||
props: {},
|
||||
data: function () {
|
||||
return {
|
||||
couponsList: [],
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
$yroute: function (n) {
|
||||
var that = this;
|
||||
if (n.name === NAME) {
|
||||
that.getUseCoupons();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
this.getUseCoupons();
|
||||
},
|
||||
methods: {
|
||||
getUseCoupons: function () {
|
||||
let that = this,
|
||||
type = 0;
|
||||
getCouponsUser(type).then(res => {
|
||||
that.couponsList = res.data;
|
||||
that.loading = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<view class="cash-audit">
|
||||
<view class="pictrue">
|
||||
<image :src="`${staticUrl}/examine.png`" />
|
||||
</view>
|
||||
<view class="tip">提现申请已提交,等待人工审核</view>
|
||||
<view class="time">{{ time }}</view>
|
||||
<view class="bnt bg-color-red" @click="goUserPromotion()">好的</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "CashAudit",
|
||||
components: {},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
staticUrl:this.$STATIC_RESOURCE_URL,
|
||||
time: ""
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
let myData = new Date();
|
||||
this.time = myData.toLocaleString();
|
||||
},
|
||||
methods: {
|
||||
goUserPromotion() {
|
||||
this.$yrouter.back();
|
||||
// this.$yrouter.push({ path: "/pages/user/promotion/UserPromotion/index" });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,162 @@
|
||||
<template>
|
||||
<view class="commission-details" ref="container">
|
||||
<view class="promoterHeader bg-color-red">
|
||||
<view class="headerCon acea-row row-between-wrapper">
|
||||
<view>
|
||||
<view class="name">提现记录</view>
|
||||
<view class="money">
|
||||
¥
|
||||
<text class="num">{{ force2Decimal(commission) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="iconfont icon-jinbi1"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sign-record" ref="content">
|
||||
<view class="list">
|
||||
<view class="item">
|
||||
<view class="listn" v-for="(item, infoIndex) in info" :key="infoIndex">
|
||||
<view class="itemn acea-row row-column row-center">
|
||||
<view class="acea-row row-middle row-between">
|
||||
<view class="txt">提现金额:<text class="font-color-red">{{ force2Decimal(item.extractPrice) }}</text></view>
|
||||
<view class="txt">手续费:<text class="font-color-red">{{ force2Decimal(item.extractSxf) }}</text></view>
|
||||
</view>
|
||||
<view class="txt" v-if="item.status==-1">失败原因:{{item.failMsg}}</view>
|
||||
<view class="acea-row row-middle row-between row-center">
|
||||
<view class="txt">{{item.createTime}}</view>
|
||||
<view class="txt font-color-green">{{item.statusText}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="sign-record" ref="content">
|
||||
<view class="list">
|
||||
<view class="item" v-for="(item, infoIndex) in info" :key="infoIndex">
|
||||
<view class="data">{{ item.time }}</view>
|
||||
<view class="listn" v-for="(val, indexn) in item.list" :key="indexn">
|
||||
<view class="itemn acea-row row-between-wrapper">
|
||||
<view>
|
||||
<view class="name line1">{{ val.title }}</view>
|
||||
<view>{{ val.addTime }}</view>
|
||||
</view>
|
||||
<view class="num" v-if="val.pm == 1">+{{ force2Decimal(val.number) }}</view>
|
||||
<view class="num font-color-red" v-if="val.pm == 0">-{{ force2Decimal(val.number) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<Loading :loaded="loaded" :loading="loading"></Loading>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getCommissionInfo, getSpreadInfo,getWithdrawalRecordList } from "@/api/user";
|
||||
import Loading from "@/components/Loading";
|
||||
import { formatDateTime,isNullOrEmpty} from "@/utils";
|
||||
|
||||
export default {
|
||||
name: "CashRecord",
|
||||
components: {
|
||||
Loading
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
info: [],
|
||||
commission: 0,
|
||||
where: {
|
||||
page: 1,
|
||||
limit: 10
|
||||
},
|
||||
types: 4,
|
||||
loaded: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getCommission();
|
||||
this.getIndex();
|
||||
},
|
||||
onReachBottom() {
|
||||
this.loading === false && this.getIndex();
|
||||
},
|
||||
methods: {
|
||||
fitDateString(str,format){
|
||||
return formatDateTime(str,format);
|
||||
},
|
||||
force2Decimal(v){
|
||||
return this.$force2Decimal(v);
|
||||
},
|
||||
getIndex: function() {
|
||||
let that = this;
|
||||
if (that.loading == true || that.loaded == true) return;
|
||||
that.loading = true;
|
||||
|
||||
getWithdrawalRecordList(that.where).then(
|
||||
//getCommissionInfo(that.where, that.types).then(
|
||||
res => {
|
||||
that.loading = false;
|
||||
that.loaded = res.data.length < that.where.limit;
|
||||
that.where.page = that.where.page + 1;
|
||||
that.info.push.apply(that.info, res.data.map((item)=>{
|
||||
switch (item.status){
|
||||
case -1:
|
||||
item.statusText = "提现未通过";
|
||||
break;
|
||||
case 0:
|
||||
item.statusText = "提现审核中";
|
||||
break;
|
||||
case 1:
|
||||
item.statusText = "提现已完成";
|
||||
break;
|
||||
case 2:
|
||||
item.statusText = "提现待打款";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return item;
|
||||
}));
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
getCommission: function() {
|
||||
let that = this;
|
||||
getSpreadInfo().then(
|
||||
res => {
|
||||
that.commission = res.data.commissionCount;
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.txt{
|
||||
font-size: 28rpx;
|
||||
color: #282828;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.sign-record .list .item .listn .itemn{
|
||||
height: auto;
|
||||
padding-top: 10rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<view class="commission-details" ref="container">
|
||||
<view class="promoterHeader bg-color-red">
|
||||
<view class="headerCon acea-row row-between-wrapper">
|
||||
<view>
|
||||
<view class="name">佣金明细</view>
|
||||
<view class="money">
|
||||
¥<text class="num">{{ force2Decimal(commission) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sign-record" ref="content">
|
||||
<view class="list">
|
||||
<view class="item" v-for="(item, infoIndex) in info" :key="infoIndex">
|
||||
<view class="data">{{ item.time }}</view>
|
||||
<view class="listn" v-for="(val, indexn) in item.list" :key="indexn">
|
||||
<view class="itemn acea-row row-between-wrapper">
|
||||
<view>
|
||||
<view class="name line1">{{ val.title }}</view>
|
||||
<view>{{ val.addTime }}</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="" style="flex-shrink: 0;text-align: right;">{{val.status==0?"待收货确定":(val.status==1?"有效":"无效")}}</view>
|
||||
<view class="">
|
||||
<view class="num" v-if="val.pm == 1">+{{ force2Decimal(val.number) }}</view>
|
||||
<view class="num font-color-red" v-if="val.pm == 0">
|
||||
-{{ force2Decimal(val.number) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<Loading :loaded="loaded" :loading="loading"></Loading>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getCommissionInfo, getSpreadInfo } from "@/api/user";
|
||||
import Loading from "@/components/Loading";
|
||||
|
||||
export default {
|
||||
name: "CommissionDetails",
|
||||
components: {
|
||||
Loading
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
info: [],
|
||||
commission: 0,
|
||||
where: {
|
||||
page: 1,
|
||||
limit: 3
|
||||
},
|
||||
types: 9,//3,
|
||||
loaded: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getCommission();
|
||||
this.getIndex();
|
||||
},
|
||||
onReachBottom() {
|
||||
this.loading === false && this.getIndex();
|
||||
},
|
||||
methods: {
|
||||
force2Decimal(v){
|
||||
return this.$force2Decimal(v);
|
||||
},
|
||||
getIndex: function() {
|
||||
let that = this;
|
||||
if (that.loading == true || that.loaded == true) return;
|
||||
that.loading = true;
|
||||
getCommissionInfo(that.where, that.types).then(
|
||||
res => {
|
||||
that.loading = false;
|
||||
that.loaded = res.data.length < that.where.limit;
|
||||
that.loadTitle = that.loaded ? "人家是有底线的" : "上拉加载更多";
|
||||
that.where.page = that.where.page + 1;
|
||||
that.info.push.apply(that.info, res.data);
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
getCommission: function() {
|
||||
let that = this;
|
||||
getSpreadInfo().then(
|
||||
res => {
|
||||
that.commission = res.data.commissionCount;
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,160 @@
|
||||
<template>
|
||||
<view class="distribution-posters">
|
||||
<view class="slider-banner banner">
|
||||
<swiper indicatorDots="true">
|
||||
<block v-for="(item, infoIndex) in info" :key="infoIndex">
|
||||
<swiper-item>
|
||||
<image
|
||||
class="slide-image"
|
||||
:src="item.wap_poster"
|
||||
mode="widthFix"
|
||||
show-menu-by-longpress
|
||||
/>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="keep bg-color-red" @click="saveImg">保存海报</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
// import { swiper, swiperSlide } from "vue-awesome-swiper";
|
||||
import { getSpreadImg } from "@/api/user";
|
||||
|
||||
export default {
|
||||
name: "Poster",
|
||||
components: {
|
||||
// swiper,
|
||||
// swiperSlide
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
swiperPosters: {
|
||||
speed: 1000,
|
||||
effect: "coverflow",
|
||||
slidesPerView: "auto",
|
||||
centeredSlides: true,
|
||||
coverflowEffect: {
|
||||
rotate: 0, // 旋转的角度
|
||||
stretch: -20, // 拉伸 图片间左右的间距和密集度
|
||||
depth: 100, // 深度 切换图片间上下的间距和密集度
|
||||
modifier: 3, // 修正值 该值越大前面的效果越明显
|
||||
slideShadows: false // 页面阴影效果
|
||||
},
|
||||
observer: true,
|
||||
observeParents: true
|
||||
},
|
||||
info: [],
|
||||
activeIndex: 0
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getIndex();
|
||||
let that = this;
|
||||
// this.swiper.on("slideChange", function() {
|
||||
// that.activeIndex = that.swiper.activeIndex;
|
||||
// });
|
||||
},
|
||||
computed: {
|
||||
swiper() {
|
||||
// return this.$refs.mySwiper.swiper;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getIndex: function() {
|
||||
let that = this;
|
||||
let from = {};
|
||||
if (this.$deviceType == "app") {
|
||||
from.from = "app";
|
||||
}
|
||||
getSpreadImg(from).then(
|
||||
res => {
|
||||
that.info = res.data;
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
downloadIamge: function(imgsrc, name) {
|
||||
var that = this;
|
||||
this.isDown = true;
|
||||
var downloadUrl = imgsrc;
|
||||
|
||||
if (!wx.saveImageToPhotosAlbum) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content:
|
||||
"当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"
|
||||
});
|
||||
that.openDialogVisible = true;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// 可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.writePhotosAlbum" 这个 scope
|
||||
wx.getSetting({
|
||||
success(res) {
|
||||
if (!res.authSetting["scope.writePhotosAlbum"]) {
|
||||
that.openDialogVisible = true;
|
||||
|
||||
// 接口调用询问
|
||||
wx.authorize({
|
||||
scope: "scope.writePhotosAlbum",
|
||||
success() {
|
||||
that.downloadImage(downloadUrl);
|
||||
},
|
||||
fail() {
|
||||
// 用户拒绝了授权
|
||||
// 打开设置页面
|
||||
wx.openSetting({
|
||||
success: function(data) {},
|
||||
fail: function(data) {}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
that.downloadImage(downloadUrl);
|
||||
}
|
||||
},
|
||||
fail(res) {
|
||||
that.openDialogVisible = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
saveImg: function() {
|
||||
this.downloadIamge(
|
||||
this.info[this.activeIndex].wap_poster,
|
||||
"poster" + this.activeIndex
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
page {
|
||||
height: 100%;
|
||||
}
|
||||
.distribution-posters {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banenr {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banner swiper {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banner .slide-image {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,356 @@
|
||||
<template>
|
||||
<view class="promoter-list" ref="container">
|
||||
<view class="header">
|
||||
|
||||
<!-- 搜索开始 -->
|
||||
<view class="search acea-row row-between-wrapper" style="background-color: #F5F5F5 !important;margin-top: 22rpx;">
|
||||
<form @submit.prevent="submitForm" style="width: 100% !important;">
|
||||
<view class="input" style="text-align: left !important;background: #fff !important;width: auto !important;">
|
||||
<text class="iconfont icon-sousuo2"
|
||||
style="left: 28rpx !important;right: auto !important;margin-right: 10rpx;font-size: 32rpx !important;color: #9D9D9D !important;"></text>
|
||||
<input style="margin-left: 70rpx !important;text-align: left !important;color: #CCCCCC !important;"
|
||||
placeholder="点击搜索会员名称" placeholder-style="color:#CCCCCC" v-model="screen.keyword"
|
||||
@confirm="submitForm"/>
|
||||
<!-- <text class="iconfont icon-guanbi"></text> -->
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
<!-- 搜索结束 -->
|
||||
|
||||
<view class="promoterHeader" style="height: 160rpx !important;">
|
||||
<view class="headerCon acea-row row-between-wrapper"
|
||||
style="width: auto !important;padding: 0 32rpx !important;">
|
||||
<view class="acea-row row-column">
|
||||
<view class="name"
|
||||
style="color: #000000 !important;font-size: 32rpx !important;font-weight: 500;margin-bottom: 20rpx;">
|
||||
{{ first + second || '0' }}
|
||||
</view>
|
||||
<view style="color: #8C8C8C;font-size: 24rpx;"> 推广人数(人)</view>
|
||||
</view>
|
||||
<view class="acea-row row-middle">
|
||||
<view class="dropDownBtn acea-row row-middle row-center" @click="changeGrade()">
|
||||
<text style="color: #fff;font-size: 24rpx;margin-right: 28rpx;">
|
||||
{{ screen.grade == 0 ? '一级' : '二级' }}
|
||||
</text>
|
||||
<image style="width: 24rpx;height: 12rpx;" :src="webUrl+'/20210819151908963957.png'" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 一二级筛选 -->
|
||||
<!-- <view class="nav acea-row row-around">
|
||||
<view
|
||||
class="item"
|
||||
:class="screen.grade == 0 ? 'on' : ''"
|
||||
@click="checkGrade(0)"
|
||||
>一级({{ first||'0' }})</view>
|
||||
<view
|
||||
class="item"
|
||||
:class="screen.grade == 1 ? 'on' : ''"
|
||||
@click="checkGrade(1)"
|
||||
>二级({{ second||'0' }})</view>
|
||||
</view> -->
|
||||
<!-- 一二级筛选 -->
|
||||
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="sortNav acea-row row-middle" :class="fixedState === true ? 'on' : ''">
|
||||
<view class="sortItem" :style="(childCount === 1 || childCount === 3) ? 'color:#0DC5C5' : ''"
|
||||
@click="sort('childCount')">
|
||||
团队排序
|
||||
<image :src="webUrl+'/20230304204227252460.png'" v-if="childCount == 1"/>
|
||||
<image :src="webUrl+'/20230304204233362231.png'" v-if="childCount == 2"/>
|
||||
<image :src="webUrl+'/20230304204240497772.png'" v-if="childCount == 3"/>
|
||||
</view>
|
||||
<view class="sortItem" :style="(numberCount === 1 || numberCount === 3) ? 'color:#0DC5C5' : ''"
|
||||
@click="sort('numberCount')">
|
||||
金额排序
|
||||
<image :src="webUrl+'/20230304204227252460.png'" v-if="numberCount == 1"/>
|
||||
<image :src="webUrl+'/20230304204233362231.png'" v-if="numberCount == 2"/>
|
||||
<image :src="webUrl+'/20230304204240497772.png'" v-if="numberCount == 3"/>
|
||||
</view>
|
||||
<view class="sortItem" :style="(orderCount === 1 || orderCount === 3) ? 'color:#0DC5C5' : ''"
|
||||
@click="sort('orderCount')">
|
||||
订单排序
|
||||
<image :src="webUrl+'/20230304204227252460.png'" v-if="orderCount == 1"/>
|
||||
<image :src="webUrl+'/20230304204233362231.png'" v-if="orderCount == 2"/>
|
||||
<image :src="webUrl+'/20230304204240497772.png'" v-if="orderCount == 3"/>
|
||||
</view>
|
||||
<view class="sortItem" :style="(levelCount === 1 || levelCount === 3) ? 'color:#0DC5C5' : ''"
|
||||
@click="sort('levelCount')">
|
||||
等级排序
|
||||
<image :src="webUrl+'/20230304204227252460.png'" v-if="levelCount == 1"/>
|
||||
<image :src="webUrl+'/20230304204233362231.png'" v-if="levelCount == 2"/>
|
||||
<image :src="webUrl+'/20230304204240497772.png'" v-if="levelCount == 3"/>
|
||||
</view>
|
||||
</view>
|
||||
<view :class="fixedState === true ? 'sortList' : ''">
|
||||
<view
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-for="(val, spreadListIndex) in spreadList"
|
||||
:key="spreadListIndex"
|
||||
>
|
||||
<view class="picTxt acea-row row-between-wrapper" style="flex-wrap: nowrap;">
|
||||
<view class="" style="width: 60rpx;word-wrap: break-word;text-align: center;margin-right: 8rpx;">
|
||||
{{ spreadListIndex + 1 }}
|
||||
</view>
|
||||
<view class="pictrue" style="flex-shrink: 0;margin-right: 8rpx;">
|
||||
<image :src="val.avatar"/>
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="name line1 acea-row row-middle">{{ val.nickname }}
|
||||
<text class="levelBox">{{ val.levelName }}</text>
|
||||
</view>
|
||||
<view style="color: #999999 !important;">加入时间: {{ val.time }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view>
|
||||
<text class="font-color-red">{{ val.childCount }}</text>
|
||||
人
|
||||
</view>
|
||||
<view>{{ val.orderCount }}单</view>
|
||||
<view>
|
||||
<text class="font-color-red">{{ val.numberCount ? val.numberCount : 0 }}</text>
|
||||
元
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<Loading :loaded="loaded" :loading="loading"></Loading>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import {getSpreadUser} from "@/api/user";
|
||||
import Loading from "@/components/Loading";
|
||||
|
||||
export default {
|
||||
name: "PromoterList",
|
||||
components: {
|
||||
Loading
|
||||
},
|
||||
props: {},
|
||||
data: function () {
|
||||
return {
|
||||
fixedState: false,
|
||||
screen: {
|
||||
page: 1,
|
||||
limit: 15,
|
||||
grade: 0,
|
||||
keyword: "",
|
||||
sort: ""
|
||||
},
|
||||
childCount: 2,
|
||||
numberCount: 2,
|
||||
orderCount: 2,
|
||||
levelCount: 2,
|
||||
loaded: false,
|
||||
loading: false,
|
||||
spreadList: [],
|
||||
loadTitle: "",
|
||||
first: "",
|
||||
second: "",
|
||||
webUrl: this.$VUE_APP_RESOURCES_URL
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
this.getSpreadUsers();
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loading && this.getSpreadUsers();
|
||||
},
|
||||
watch: {
|
||||
"screen.sort": function () {
|
||||
this.screen.page = 1;
|
||||
this.loaded = false;
|
||||
this.loading = false;
|
||||
this.spreadList = [];
|
||||
this.getSpreadUsers();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeGrade: function () {
|
||||
var that = this;
|
||||
uni.showActionSheet({
|
||||
itemList: ['一级', '二级'],
|
||||
success: function (res) {
|
||||
console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
|
||||
that.checkGrade(res.tapIndex);
|
||||
},
|
||||
fail: function (res) {
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
handleScroll: function () {
|
||||
// var scrollTop =
|
||||
// document.documentElement.scrollTop || document.body.scrollTop;
|
||||
// var offsetTop = document.querySelector(".header").clientHeight;
|
||||
// if (scrollTop >= offsetTop) {
|
||||
// this.fixedState = true;
|
||||
// } else {
|
||||
// this.fixedState = false;
|
||||
// }
|
||||
},
|
||||
submitForm: function () {
|
||||
this.screen.page = 1;
|
||||
this.loaded = false;
|
||||
this.loading = false;
|
||||
this.spreadList = [];
|
||||
this.getSpreadUsers();
|
||||
},
|
||||
getSpreadUsers: function () {
|
||||
let that = this,
|
||||
screen = that.screen;
|
||||
if (that.loaded || that.loading) return;
|
||||
that.loading = true;
|
||||
getSpreadUser(screen).then(
|
||||
res => {
|
||||
that.loading = false;
|
||||
that.spreadList.push.apply(that.spreadList, res.data.list);
|
||||
that.loaded = res.data.list.length < that.screen.limit; //判断所有数据是否加载完成;
|
||||
that.loadTitle = that.loaded ? "人家是有底线的" : "上拉加载更多";
|
||||
that.screen.page = that.screen.page + 1;
|
||||
that.first = res.data.total;
|
||||
that.second = res.data.totalLevel;
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title:
|
||||
err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
},
|
||||
300
|
||||
);
|
||||
},
|
||||
checkGrade: function (val) {
|
||||
if (val == this.screen.grade) return;
|
||||
else {
|
||||
this.screen.page = 1;
|
||||
this.screen.grade = val;
|
||||
this.loading = false;
|
||||
this.loaded = false;
|
||||
this.spreadList = [];
|
||||
this.getSpreadUsers();
|
||||
}
|
||||
},
|
||||
sort: function (types) {
|
||||
let that = this;
|
||||
switch (types) {
|
||||
case "childCount":
|
||||
if (that.childCount == 2) {
|
||||
that.childCount = 1;
|
||||
that.orderCount = 2;
|
||||
that.numberCount = 2;
|
||||
that.levelCount = 2;
|
||||
that.screen.sort = "childCount DESC";
|
||||
} else if (that.childCount == 1) {
|
||||
that.childCount = 3;
|
||||
that.orderCount = 2;
|
||||
that.numberCount = 2;
|
||||
that.levelCount = 2;
|
||||
that.screen.sort = "childCount ASC";
|
||||
} else if (that.childCount == 3) {
|
||||
that.childCount = 2;
|
||||
that.orderCount = 2;
|
||||
that.numberCount = 2;
|
||||
that.levelCount = 2;
|
||||
that.screen.sort = "";
|
||||
}
|
||||
break;
|
||||
case "numberCount":
|
||||
if (that.numberCount == 2) {
|
||||
that.numberCount = 1;
|
||||
that.orderCount = 2;
|
||||
that.childCount = 2;
|
||||
that.levelCount = 2;
|
||||
that.screen.sort = "numberCount DESC";
|
||||
} else if (that.numberCount == 1) {
|
||||
that.numberCount = 3;
|
||||
that.orderCount = 2;
|
||||
that.childCount = 2;
|
||||
that.levelCount = 2;
|
||||
that.screen.sort = "numberCount ASC";
|
||||
} else if (that.numberCount == 3) {
|
||||
that.numberCount = 2;
|
||||
that.orderCount = 2;
|
||||
that.childCount = 2;
|
||||
that.levelCount = 2;
|
||||
that.screen.sort = "";
|
||||
}
|
||||
break;
|
||||
case "orderCount":
|
||||
if (that.orderCount == 2) {
|
||||
that.orderCount = 1;
|
||||
that.numberCount = 2;
|
||||
that.childCount = 2;
|
||||
that.levelCount = 2;
|
||||
that.screen.sort = "orderCount DESC";
|
||||
} else if (that.orderCount == 1) {
|
||||
that.orderCount = 3;
|
||||
that.numberCount = 2;
|
||||
that.childCount = 2;
|
||||
that.levelCount = 2;
|
||||
that.screen.sort = "orderCount ASC";
|
||||
} else if (that.orderCount == 3) {
|
||||
that.orderCount = 2;
|
||||
that.numberCount = 2;
|
||||
that.childCount = 2;
|
||||
that.levelCount = 2;
|
||||
that.screen.sort = "";
|
||||
}
|
||||
break;
|
||||
case "levelCount":
|
||||
if (that.levelCount == 2) {
|
||||
that.levelCount = 1;
|
||||
that.orderCount = 2;
|
||||
that.numberCount = 2;
|
||||
that.childCount = 2;
|
||||
that.screen.sort = "level desc";
|
||||
} else if (that.levelCount == 1) {
|
||||
that.levelCount = 3;
|
||||
that.orderCount = 2;
|
||||
that.numberCount = 2;
|
||||
that.childCount = 2;
|
||||
that.screen.sort = "level ASC";
|
||||
} else if (that.levelCount == 3) {
|
||||
that.levelCount = 2;
|
||||
that.orderCount = 2;
|
||||
that.numberCount = 2;
|
||||
that.childCount = 2;
|
||||
that.screen.sort = "";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
that.screen.sort = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.dropDownBtn {
|
||||
width: 176rpx;
|
||||
height: 60rpx;
|
||||
background: #0DC5C5;
|
||||
box-shadow: 0px 8rpx 14rpx rgba(179, 188, 191, 0.6);
|
||||
opacity: 1;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.levelBox {
|
||||
padding: 0 10rpx;
|
||||
font-size: 18rpx;
|
||||
line-height: 28rpx;
|
||||
height: 28rpx;
|
||||
background: #FF564A;
|
||||
color: #fff;
|
||||
border-radius: 14rpx;
|
||||
margin-left: 14rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<view class="promoter-order" ref="container">
|
||||
<view class="promoterHeader bg-color-red">
|
||||
<view class="headerCon acea-row row-between-wrapper" style="flex-wrap: nowrap;">
|
||||
<view style="flex-shrink: 0;margin-right: 40rpx;">
|
||||
<text class="name">累计推广订单</text>
|
||||
<view>
|
||||
<text class="num">{{ count||'0' }}</text>
|
||||
<text>单</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="flex-grow: 1;font-size: 24rpx;">
|
||||
返佣说明:1.下线客户下单成功后,平台设置为默认7天收货成功,佣金便自动计算添加到上线的返佣;2.如过程中下单客户有退货退款,则此订单返佣无效,会自动取消或相应扣除。
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item" v-for="(item, listIndex) in list" :key="listIndex">
|
||||
<view class="title acea-row row-column row-center">
|
||||
<view class="data">{{ item.time }}</view>
|
||||
<text>本月累计推广订单:{{ item.count ? item.count : 0 }}单</text>
|
||||
</view>
|
||||
<view class="listn">
|
||||
<view class="itenm" v-for="(val, indexn) in item.child" :key="indexn">
|
||||
<view class="top acea-row row-between-wrapper">
|
||||
<view class="pictxt acea-row row-between-wrapper">
|
||||
<view class="pictrue">
|
||||
<image :src="val.avatar" />
|
||||
</view>
|
||||
<text class="text line1">{{ val.nickname }}</text>
|
||||
</view>
|
||||
<view class="money">
|
||||
<text>返佣:</text>
|
||||
<text class="font-color-red">¥{{ val.number ? val.number : 0 }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
|
||||
<view class="acea-row row-between" style="flex-wrap: nowrap;">
|
||||
<view style="flex-grow: 1;">
|
||||
<text class="name">订单金额:</text>
|
||||
<text class="font-color-red">¥{{ val.payPrice || 0 }}(¥{{ val.totalPrice || 0 }}+¥{{ val.totalPostage || 0 }}运费)</text>
|
||||
</view>
|
||||
<view class="" style="flex-shrink: 0;">{{val.billStatus==0?"待收货确定":(val.billStatus==1?"有效":"无效")}}</view>
|
||||
</view>
|
||||
<view>
|
||||
<text class="name">订单号:</text>
|
||||
{{ val.orderId }}
|
||||
</view>
|
||||
<view>
|
||||
<text class="name">下单时间:</text>
|
||||
{{ val.time }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<Loading :loaded="loaded" :loading="loading"></Loading>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getSpreadOrder } from "@/api/user";
|
||||
import Loading from "@/components/Loading";
|
||||
export default {
|
||||
name: "PromoterOrder",
|
||||
components: {
|
||||
Loading
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
list: [],
|
||||
where: {
|
||||
page: 1,
|
||||
limit: 15
|
||||
},
|
||||
loaded: false,
|
||||
loading: false,
|
||||
loadTitle: "",
|
||||
count: ""
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getIndex();
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loading && this.getIndex();
|
||||
},
|
||||
methods: {
|
||||
getIndex: function() {
|
||||
let there = this;
|
||||
if (there.loaded == true || there.loading == true) return;
|
||||
there.loading = true;
|
||||
getSpreadOrder(there.where).then(
|
||||
res => {
|
||||
there.loading = false;
|
||||
there.loaded = res.data.list.length < there.where.limit;
|
||||
there.loadTitle = there.loaded ? "人家是有底线的" : "上拉加载更多";
|
||||
there.where.page = there.where.page + 1;
|
||||
there.list.push.apply(there.list, res.data.list);
|
||||
there.count = res.data.count;
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
},
|
||||
300
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
|
||||
.promoterHeader .headerCon{
|
||||
width: auto !important;
|
||||
padding: 0 20rpx 0 20rpx !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,212 @@
|
||||
<template>
|
||||
<view class="cash-withdrawal">
|
||||
<view class="nav acea-row">
|
||||
<view
|
||||
v-for="(item, navListIndex) in navList"
|
||||
class="item font-color-red"
|
||||
@click="swichNav(navListIndex, item)"
|
||||
:key="navListIndex"
|
||||
>
|
||||
<view class="line bg-color-red" :class="currentTab === navListIndex ? 'on' : ''"></view>
|
||||
<view class="iconfont" :class="item.icon + ' ' + (currentTab === navListIndex ? 'on' : '')"></view>
|
||||
<view>{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
<view :hidden="currentTab !== 0" class="list">
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view class="name">微信号</view>
|
||||
<view class="input">
|
||||
<input placeholder="请输入微信号" v-model="post.weixin" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view class="name">提现</view>
|
||||
<view class="input">
|
||||
<input :placeholder="'最低提现金额' + minPrice" v-model="post.money" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="tip">当前可提现金额: {{ commissionCount }}</view>
|
||||
<view class="bnt bg-color-red" @click="submitted">提现</view>
|
||||
</view>
|
||||
<view :hidden="currentTab !== 1" class="list">
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view class="name">用户名</view>
|
||||
<view class="input">
|
||||
<input placeholder="请填写您的支付宝用户名" v-model="post.name" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view class="name">账号</view>
|
||||
<view class="input">
|
||||
<input placeholder="请填写您的支付宝账号" v-model="post.alipay_code" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view class="name">提现</view>
|
||||
<view class="input">
|
||||
<input :placeholder="'最低提现金额' + minPrice" v-model="post.money" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="tip">当前可提现金额: {{ commissionCount }}</view>
|
||||
<view class="bnt bg-color-red" @click="submitted">提现</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getBank, postCashInfo } from "@/api/user";
|
||||
import { required } from "@/utils/validate";
|
||||
import { validatorDefaultCatch } from "@/utils/dialog";
|
||||
|
||||
export default {
|
||||
name: "UserCash",
|
||||
components: {},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
navList: [
|
||||
{ name: "微信", type: "weixin", icon: "icon-weixin2" },
|
||||
{ name: "支付宝", type: "alipay", icon: "icon-icon34" }
|
||||
],
|
||||
post: {
|
||||
extract_type: "weixin",
|
||||
alipay_code: "",
|
||||
money: "",
|
||||
name: "",
|
||||
bankname: "",
|
||||
cardnum: "",
|
||||
weixin: ""
|
||||
},
|
||||
currentTab: 0,
|
||||
minPrice: 0,
|
||||
banks: [],
|
||||
commissionCount: 0
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getBank();
|
||||
},
|
||||
methods: {
|
||||
swichNav: function(index, item) {
|
||||
console.log(item);
|
||||
this.currentTab = index;
|
||||
this.post.extract_type = item.type;
|
||||
},
|
||||
getBank: function() {
|
||||
let that = this;
|
||||
getBank().then(
|
||||
res => {
|
||||
that.banks = res.data.extractBank;
|
||||
that.minPrice = res.data.minPrice;
|
||||
that.commissionCount = res.data.commissionCount;
|
||||
},
|
||||
function(err) {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
async submitted() {
|
||||
let bankname = this.post.bankname,
|
||||
alipay_code = this.post.alipay_code,
|
||||
money = this.post.money,
|
||||
name = this.post.name,
|
||||
cardnum = this.post.cardnum,
|
||||
weixin = this.post.weixin,
|
||||
that = this;
|
||||
// console.log(parseFloat(money))
|
||||
if (
|
||||
parseFloat(money) > parseFloat(that.commissionCount) ||
|
||||
parseFloat(that.commissionCount) == 0
|
||||
)
|
||||
return that.$dialog.message("余额不足");
|
||||
if (parseFloat(money) < parseFloat(that.minPrice))
|
||||
return that.$dialog.message("最低提现金额" + that.minPrice);
|
||||
//console.log(that.post.extract_type)
|
||||
switch (that.post.extract_type) {
|
||||
case "alipay":
|
||||
// if (!name) {
|
||||
// uni.showToast({
|
||||
// title: "请输入支付宝用户名",
|
||||
// icon: "none",
|
||||
// duration: 2000
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// if (!alipay_code) {
|
||||
// uni.showToast({
|
||||
// title: "请输入支付宝账号",
|
||||
// icon: "none",
|
||||
// duration: 2000
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// if (!money) {
|
||||
// uni.showToast({
|
||||
// title: "请输入提现金额",
|
||||
// icon: "none",
|
||||
// duration: 2000
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
try {
|
||||
await this.$validator({
|
||||
name: [required(required.message("支付宝用户名"))],
|
||||
alipay_code: [required(required.message("支付宝账号"))],
|
||||
money: [required(required.message("提现金额"))]
|
||||
}).validate({ name, alipay_code, money });
|
||||
let save = {
|
||||
extractType: that.post.extract_type,
|
||||
alipayCode: alipay_code,
|
||||
name: name,
|
||||
money: money
|
||||
};
|
||||
that.save(save);
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
break;
|
||||
case "weixin":
|
||||
try {
|
||||
await this.$validator({
|
||||
weixin: [required(required.message("提现微信号"))],
|
||||
money: [required(required.message("提现金额"))]
|
||||
}).validate({ weixin, money });
|
||||
let save = {
|
||||
extractType: that.post.extract_type,
|
||||
weixin: weixin,
|
||||
money: money
|
||||
};
|
||||
that.save(save);
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
save: function(info) {
|
||||
postCashInfo(info).then(
|
||||
res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
this.router.push({ path: "/user/audit" });
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,241 @@
|
||||
<template>
|
||||
<view class="my-promotion">
|
||||
|
||||
<view class="topBanner acea-row row-middle row-center">
|
||||
<view class="item acea-row row-column">
|
||||
<view class="itemValue">{{ force2Decimal(Info.commissionCount) }}</view>
|
||||
<view class="itemTitle">当前佣金</view>
|
||||
</view>
|
||||
<view class="vline"></view>
|
||||
<view class="item acea-row row-column">
|
||||
<view class="itemValue">{{ force2Decimal(Info.lastDayCount) }}</view>
|
||||
<view class="itemTitle">今日收益</view>
|
||||
</view>
|
||||
<view class="vline"></view>
|
||||
<view class="item acea-row row-column">
|
||||
<view class="itemValue">{{ force2Decimal(Info.extractCount) }}</view>
|
||||
<view class="itemTitle">累计已提</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="acea-row row-right">
|
||||
<view class="withdrawRecordBtn acea-row row-middle row-center" @click="goCashRecord()">
|
||||
<image :src="webUrl+'/20210819120620545726.png'" mode="" style="width: 24rpx;height: 24rpx;margin-right: 10rpx;"></image>
|
||||
<text style="color: #fff;font-size: 24rpx;">提现记录</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="menu-list acea-row row-column">
|
||||
<view class="menu-item acea-row row-middle" @click="goPromoterList()">
|
||||
<image class="menu-item-img" :src="webUrl+'/20210819120915878640.png'" mode=""></image>
|
||||
<text class="menu-item-title">推广统计</text>
|
||||
<text class="iconfont icon-jiantou" style="font-size: 24rpx;color: #999999;"></text>
|
||||
</view>
|
||||
<view class="menu-item acea-row row-middle" @click="goCommissionDetails()">
|
||||
<image class="menu-item-img" :src="webUrl+'/20210819133737716135.png'" mode=""></image>
|
||||
<text class="menu-item-title">佣金明细</text>
|
||||
<text class="iconfont icon-jiantou" style="font-size: 24rpx;color: #999999;"></text>
|
||||
</view>
|
||||
<view class="menu-item acea-row row-middle" @click="goPromoterOrder()">
|
||||
<image class="menu-item-img" :src="webUrl+'/20210819133751983817.png'" mode=""></image>
|
||||
<text class="menu-item-title">推广人订单</text>
|
||||
<text class="iconfont icon-jiantou" style="font-size: 24rpx;color: #999999;"></text>
|
||||
</view>
|
||||
<view class="menu-item acea-row row-middle" @click="toCash()">
|
||||
<image class="menu-item-img" :src="webUrl+'/20210819133726059725.png'" mode=""></image>
|
||||
<text class="menu-item-title">立即提现</text>
|
||||
<text class="iconfont icon-jiantou" style="font-size: 24rpx;color: #999999;"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<!-- <view class="header">
|
||||
<view class="name acea-row row-center-wrapper">
|
||||
<view>当前佣金</view>
|
||||
<view class="record" @click="goCashRecord()">
|
||||
提现记录
|
||||
<text class="iconfont icon-xiangyou"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="num">{{ force2Decimal(Info.commissionCount) }}</view>
|
||||
<view class="profit acea-row row-between-wrapper">
|
||||
<view class="item">
|
||||
<view>今日收益</view>
|
||||
<view class="money">{{ force2Decimal(Info.lastDayCount) }}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view>累积已提</view>
|
||||
<view class="money">{{ force2Decimal(Info.extractCount) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list acea-row row-between-wrapper">
|
||||
<view class="item acea-row row-center-wrapper row-column" @click="goPoster()">
|
||||
<text class="iconfont icon-erweima"></text>
|
||||
<view>推广名片</view>
|
||||
</view>
|
||||
<view class="item acea-row row-center-wrapper row-column" @click="goPromoterList()">
|
||||
<text class="iconfont icon-tongji"></text>
|
||||
<view>推广人统计</view>
|
||||
</view>
|
||||
<view class="item acea-row row-center-wrapper row-column" @click="goCommissionDetails()">
|
||||
<text class="iconfont icon-qiandai"></text>
|
||||
<view>佣金明细</view>
|
||||
</view>
|
||||
<view class="item acea-row row-center-wrapper row-column" @click="goPromoterOrder()">
|
||||
<text class="iconfont icon-dingdan"></text>
|
||||
<view>推广人订单</view>
|
||||
</view>
|
||||
<view class="item acea-row row-center-wrapper row-column" @click="toCash()">
|
||||
<text class="iconfont icon-chongzhi"></text>
|
||||
<view>立即提现</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
|
||||
|
||||
import { getSpreadInfo } from "@/api/user";
|
||||
|
||||
export default {
|
||||
name: "UserPromotion",
|
||||
components: {},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
Info: {
|
||||
lastDayCount: 0,
|
||||
extractCount: 0,
|
||||
commissionCount: 0
|
||||
},
|
||||
webUrl:this.$VUE_APP_RESOURCES_URL
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
|
||||
},
|
||||
onShow:function(){
|
||||
this.getInfo();
|
||||
},
|
||||
methods: {
|
||||
force2Decimal(v){
|
||||
return this.$force2Decimal(v);
|
||||
},
|
||||
goPoster() {
|
||||
this.$yrouter.push("/pages/user/promotion/Poster/index");
|
||||
},
|
||||
goCashRecord() {
|
||||
this.$yrouter.push("/pages/user/promotion/CashRecord/index");
|
||||
},
|
||||
goPromoterList() {
|
||||
this.$yrouter.push("/pages/user/promotion/PromoterList/index");
|
||||
},
|
||||
goCommissionDetails() {
|
||||
this.$yrouter.push("/pages/user/promotion/CommissionDetails/index");
|
||||
},
|
||||
goPromoterOrder() {
|
||||
this.$yrouter.push("/pages/user/promotion/PromoterOrder/index");
|
||||
},
|
||||
getInfo: function() {
|
||||
let that = this;
|
||||
getSpreadInfo().then(
|
||||
res => {
|
||||
that.Info = res.data;
|
||||
},
|
||||
function(err) {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
toCash: function() {
|
||||
this.$yrouter.push("/pkg_user/views/withdrawal");
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="less">
|
||||
.my-promotion{
|
||||
padding: 32rpx;
|
||||
}
|
||||
.my-promotion .header{
|
||||
background-image: none !important;
|
||||
background-color: #FE5261;
|
||||
}
|
||||
.my-promotion .list .item .iconfont{
|
||||
color: #FE5261 !important;
|
||||
}
|
||||
|
||||
.topBanner{
|
||||
height: 180rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 6rpx 16rpx rgba(232, 236, 241, 0.5);
|
||||
border-radius: 16rpx;
|
||||
padding: 32rpx;
|
||||
}
|
||||
.topBanner .item{
|
||||
flex: 1;
|
||||
}
|
||||
.topBanner .item .itemValue{
|
||||
color: #333333;
|
||||
font-size: 36rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.topBanner .item .itemTitle{
|
||||
color: #999999;
|
||||
font-size: 22rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.vline{
|
||||
background-color: #E3E3E3;
|
||||
width: 1px;
|
||||
height: 64rpx;
|
||||
margin: 0 10rpx;
|
||||
}
|
||||
.withdrawRecordBtn{
|
||||
width: 174rpx;
|
||||
height: 60rpx;
|
||||
background: #0DC5C5;
|
||||
box-shadow: 0px 8rpx 14rpx rgba(179, 188, 191, 0.6);
|
||||
border-radius: 8rpx;
|
||||
margin: 32rpx 0;
|
||||
}
|
||||
|
||||
|
||||
.menu-list{
|
||||
|
||||
}
|
||||
.menu-list .menu-item{
|
||||
padding: 24rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 6rpx 16rpx rgba(232, 236, 241, 0.5);
|
||||
border-radius: 16rpx;
|
||||
margin-bottom: 18rpx;
|
||||
}
|
||||
|
||||
.menu-list .menu-item .menu-item-title{
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.menu-list .menu-item .menu-item-img{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
flex-shrink:0;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<view class="integral-details" ref="container">
|
||||
<view class="header">
|
||||
<view class="currentScore">当前积分</view>
|
||||
<view>{{ info.integral }}</view>
|
||||
<view class="line"></view>
|
||||
<!--<view class="nav acea-row">-->
|
||||
<!--<view class="item">-->
|
||||
<!--<view class="num">{{ info.sum_integral }}</view>-->
|
||||
<!--<view>累计积分</view>-->
|
||||
<!--</view>-->
|
||||
<!--<view class="item">-->
|
||||
<!--<view class="num">{{ info.deduction_integral }}</view>-->
|
||||
<!--<view>累计消费</view>-->
|
||||
<!--</view>-->
|
||||
<!--<view class="item">-->
|
||||
<!--<view class="num">{{ info.today_integral }}</view>-->
|
||||
<!--<view>今日获得</view>-->
|
||||
<!--</view>-->
|
||||
<!--</view>-->
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
<view class="nav acea-row">
|
||||
<view
|
||||
class="item acea-row row-center-wrapper"
|
||||
:class="current === navListIndex ? 'on' : ''"
|
||||
v-for="(item, navListIndex) in navList"
|
||||
:key="navListIndex"
|
||||
@click="nav(navListIndex)"
|
||||
>
|
||||
<text class="iconfont" :class="item.icon"></text>
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="list" :hidden="current !== 0">
|
||||
<!--<view class="tip acea-row row-middle">-->
|
||||
<!--<text class="iconfont icon-shuoming"><text-->
|
||||
<!-->提示:积分数值的高低会直接影响您的会员等级-->
|
||||
<!--</view>-->
|
||||
<view
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-for="(item, listIndex) in list"
|
||||
:key="listIndex"
|
||||
>
|
||||
<view>
|
||||
<text class="state">{{ item.title }}</text>
|
||||
<view>
|
||||
<data-format :date="item.addTime"></data-format>
|
||||
</view>
|
||||
</view>
|
||||
<text class="num" v-if="item.pm == 1">+{{ item.number }}</text>
|
||||
<text class="num font-color-red" v-if="item.pm == 0">-{{ item.number }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<Loading :loaded="loaded" :loading="loading"></Loading>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getIntegralList, postSignUser } from "@/api/user";
|
||||
import Loading from "@/components/Loading";
|
||||
import DataFormat from "@/components/DataFormat";
|
||||
export default {
|
||||
name: "Integral",
|
||||
components: {
|
||||
Loading,
|
||||
DataFormat
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
navList: [
|
||||
{ name: "分值明细", icon: "icon-mingxi" }
|
||||
// { name: "分值提升", icon: "icon-tishengfenzhi" }
|
||||
],
|
||||
current: 0,
|
||||
where: {
|
||||
page: 1,
|
||||
limit: 15
|
||||
},
|
||||
data: {
|
||||
sign: 1,
|
||||
integral: 1,
|
||||
all: 1
|
||||
},
|
||||
list: [],
|
||||
info: [],
|
||||
loaded: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getIntegral();
|
||||
this.getInfo();
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loading && this.getInfo();
|
||||
},
|
||||
methods: {
|
||||
goSignIn() {
|
||||
this.$yrouter.push("/pages/user/signIn/Sign/index");
|
||||
},
|
||||
goHome() {
|
||||
this.$yrouter.switchTab("/pages/home/index");
|
||||
},
|
||||
nav: function(index) {
|
||||
this.current = index;
|
||||
},
|
||||
getInfo: function() {
|
||||
let that = this;
|
||||
if (that.loaded == true || that.loading == true) return;
|
||||
that.loading = true;
|
||||
getIntegralList(that.where).then(
|
||||
res => {
|
||||
that.loading = false;
|
||||
that.loaded = res.data.length < that.where.limit;
|
||||
that.loadTitle = that.loaded ? "人家是有底线的" : "上拉加载更多";
|
||||
that.where.page = that.where.page + 1;
|
||||
that.list.push.apply(that.list, res.data);
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
getIntegral: function() {
|
||||
let that = this;
|
||||
postSignUser(that.data).then(
|
||||
res => {
|
||||
that.info = res.data;
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.list {
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<view class="sign">
|
||||
<view class="header bg-color-red">
|
||||
<view class="headerCon acea-row row-between-wrapper">
|
||||
<view class="left acea-row row-between-wrapper">
|
||||
<view class="pictrue">
|
||||
<image :src="userInfo.avatar" />
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="line1">{{ userInfo.nickname }}</view>
|
||||
<view class="integral acea-row">
|
||||
<text>积分: {{ userInfo.integral }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @click="goSignRecord()" class="right acea-row row-middle">
|
||||
<view class="iconfont icon-caidan"></view>
|
||||
<view>明细</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
<view class="list acea-row row-between-wrapper">
|
||||
<view class="item" v-for="(item, signSystemListIndex) in signSystemList" :key="signSystemListIndex">
|
||||
<view :class="signSystemListIndex + 1 === signSystemList.length ? 'rewardTxt' : ''">{{ item.day }}</view>
|
||||
<view class="venus" :class=" (signSystemListIndex + 1 === signSystemList.length ? 'reward' : '') +' ' + (sign_index >= signSystemListIndex + 1 ? 'venusSelect' : '')"></view>
|
||||
<view class="num" :class="sign_index >= signSystemListIndex + 1 ? 'on' : ''">+{{ item.sign_num }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--加在 but 上 on 为已签到-->
|
||||
<view class="but bg-color-red" :class="userInfo.is_day_sgin ? 'on' : ''" @click="goSign">{{ userInfo.isDaySign ? "已签到" : "立即签到" }}</view>
|
||||
<view class="lock"></view>
|
||||
</view>
|
||||
<view class="wrapper wrapper2">
|
||||
<view class="tip">已累计签到</view>
|
||||
<view class="list2 acea-row row-center row-bottom">
|
||||
<view class="item" v-for="(item, signCountIndex) in signCount" :key="signCountIndex">{{ item || 0 }}</view>
|
||||
<view class="data">天</view>
|
||||
</view>
|
||||
<view class="tip2">据说连续签到第{{ day }}天可获得超额积分,一定要坚持签到哦~~~</view>
|
||||
<view class="list3">
|
||||
<view class="item acea-row row-between-wrapper" v-for="(item, signListIndex) in signList" :key="signListIndex">
|
||||
<view>
|
||||
<view class="name line1">{{ item.title }}</view>
|
||||
<view class="data">{{ item.addTime }}</view>
|
||||
</view>
|
||||
<view class="num font-color-red">+{{ item.number }}</view>
|
||||
</view>
|
||||
<view @click="goSignRecord()" class="Loads acea-row row-center-wrapper" v-if="signList.length > 0">
|
||||
点击加载更多
|
||||
<view class="iconfont icon-xiangyou acea-row row-center-wrapper"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="signTip acea-row row-center-wrapper" :class="active === true ? 'on' : ''">
|
||||
<view class="signTipLight loadingpic">
|
||||
<image :src="webUrl+'/20200729163719734861.png'" />
|
||||
</view>
|
||||
<view class="signTipCon">
|
||||
<view class="state">签到成功</view>
|
||||
<view class="integral">获得{{ integral }}积分</view>
|
||||
<view class="signTipBnt" @click="close">好的</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mask" @touchmove.prevent :hidden="active === false"></view>
|
||||
</view>
|
||||
</template>
|
||||
<style scoped lang="less">
|
||||
.Loads .iconfont {
|
||||
font-size: 0.25*100rpx;
|
||||
margin: 0.02*100rpx 0 0 0.1*100rpx;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import {
|
||||
postSignUser,
|
||||
getSignConfig,
|
||||
postSignIntegral,
|
||||
getSignList
|
||||
} from "@/api/user";
|
||||
import {
|
||||
add
|
||||
} from "@/utils/bc";
|
||||
|
||||
export default {
|
||||
name: "Sign",
|
||||
components: {},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
webUrl:this.$VUE_APP_RESOURCES_URL,
|
||||
userInfo: {},
|
||||
integral: 0,
|
||||
signCount: [],
|
||||
sign_index: 0,
|
||||
signSystemList: [],
|
||||
signList: [],
|
||||
page: 1,
|
||||
limit: 3,
|
||||
active: false,
|
||||
day: ""
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
uni.showLoading({ title: "加载中", mask: true });
|
||||
this.signUser();
|
||||
this.signConfig();
|
||||
this.getSignList();
|
||||
},
|
||||
methods: {
|
||||
goSignRecord() {
|
||||
this.$yrouter.push("/pages/user/signIn/SignRecord/index");
|
||||
},
|
||||
// js给数字补0;num:需要补0的数字,length:长度(补到多少位);
|
||||
PrefixInteger: function(num, length) {
|
||||
return (Array(length).join("0") + num).slice(-length).split("");
|
||||
},
|
||||
//数字转中文
|
||||
Rp: function(n) {
|
||||
var cnum = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"];
|
||||
var s = "";
|
||||
n = "" + n; // 数字转为字符串
|
||||
for (var i = 0; i < n.length; i++) {
|
||||
s += cnum[parseInt(n.charAt(i))];
|
||||
}
|
||||
return s;
|
||||
},
|
||||
// 获取用户信息
|
||||
signUser: function() {
|
||||
let that = this;
|
||||
postSignUser({
|
||||
sign: 1
|
||||
}).then(res => {
|
||||
uni.hideLoading();
|
||||
res.data.integral = parseInt(res.data.integral);
|
||||
var sumSginDay = res.data.sumSignDay;
|
||||
that.userInfo = res.data;
|
||||
that.signCount = that.PrefixInteger(sumSginDay, 4);
|
||||
that.sign_index = parseInt(res.data.signNum);
|
||||
});
|
||||
},
|
||||
// 签到配置
|
||||
signConfig: function() {
|
||||
let that = this;
|
||||
getSignConfig().then(res => {
|
||||
that.signSystemList = res.data;
|
||||
that.day = that.Rp(that.signSystemList.length);
|
||||
});
|
||||
},
|
||||
// 用户签到
|
||||
goSign: function() {
|
||||
let that = this,
|
||||
sumSginDay = that.userInfo.sumSignDay;
|
||||
if (that.userInfo.is_day_sgin) {
|
||||
uni.showToast({
|
||||
title: "您今日已签到!",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
return
|
||||
}
|
||||
postSignIntegral().then(res => {
|
||||
that.active = true;
|
||||
that.integral = res.data.integral;
|
||||
let sign_index = parseInt(that.sign_index + 1);
|
||||
that.sign_index =
|
||||
sign_index > that.signSystemList.length ? 1 : sign_index;
|
||||
that.signCount = that.PrefixInteger(sumSginDay + 1, 4);
|
||||
that.userInfo.is_day_sgin = true;
|
||||
that.userInfo.integral = add(that.userInfo.integral, res.data.integral);
|
||||
that.getSignList();
|
||||
});
|
||||
},
|
||||
// 获取签到列表;
|
||||
getSignList: function() {
|
||||
let that = this;
|
||||
getSignList(that.page, that.limit).then(res => {
|
||||
that.signList = res.data;
|
||||
});
|
||||
},
|
||||
close: function() {
|
||||
this.active = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<view class="sign-record" ref="container">
|
||||
<view class="list">
|
||||
<view class="item" v-for="(item, signListIndex) in signList" :key="signListIndex">
|
||||
<view class="data">{{ item.time }}</view>
|
||||
<view class="listn">
|
||||
<view
|
||||
class="itemn acea-row row-between-wrapper"
|
||||
v-for="(itemn, indexn) in item.list"
|
||||
:key="indexn"
|
||||
>
|
||||
<view>
|
||||
<view class="name line1">{{ itemn.title }}</view>
|
||||
<view>{{ itemn.addTime }}</view>
|
||||
</view>
|
||||
<view class="num font-color-red">+{{ itemn.number }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<Loading :loaded="loadend" :loading="loading"></Loading>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getSignMonth } from "@/api/user";
|
||||
import Loading from "@/components/Loading";
|
||||
export default {
|
||||
name: "SignRecord",
|
||||
components: {
|
||||
Loading
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
page: 1,
|
||||
limit: 3,
|
||||
signList: [],
|
||||
loading: false,
|
||||
loadend: false,
|
||||
active: false
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.signListTap();
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loading && this.signListTap();
|
||||
},
|
||||
methods: {
|
||||
signListTap: function() {
|
||||
let that = this;
|
||||
if (that.loading) return; //阻止下次请求(false可以进行请求);
|
||||
if (that.loadend) return; //阻止结束当前请求(false可以进行请求);
|
||||
that.loading = true;
|
||||
getSignMonth(that.page, that.limit).then(res => {
|
||||
that.loading = false;
|
||||
//apply();js将一个数组插入另一个数组;
|
||||
that.signList.push.apply(that.signList, res.data);
|
||||
that.loadend = res.data.length < that.limit; //判断所有数据是否加载完成;
|
||||
that.page = that.page + 1;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user