feat:v1.4前端更新

This commit is contained in:
超凡
2025-06-24 14:43:09 +08:00
parent 0268aa5033
commit 35fec82e4a
1026 changed files with 118424 additions and 56490 deletions

View File

File diff suppressed because one or more lines are too long

View File

@@ -1,24 +1,37 @@
<template>
<view class="appBox">
<div class="shading">
<image :src="logoUrl" v-if="logoUrl" />
<image src="/static/images/logo2.png" v-else />
</div>
<mobileLogin :isUp="isUp" :isShow="isShow" :platform="platform" :isPos="isPos" :appleShow="appleShow" :authKey="authKey" @wechatPhone="wechatPhone"></mobileLogin>
<view class="wrapper" :data-theme="theme">
<view class="bag"></view>
<view class="system-height" :style="{height:statusBarHeight}"></view>
<!-- #ifdef MP -->
<view class="title-bar" style="height: 43px;">
<view class="icon" @click="back" v-if="!isHome">
<image class="img" :src="urlDomain+'crmebimage/perset/usersImg/left.png'"></image>
</view>
<view class="icon" @click="home" v-else>
<image class="img" :src="urlDomain+'crmebimage/perset/usersImg/home.png'"></image>
</view>
账户登录
</view>
<!-- #endif -->
<view class="appBox">
<view class="phone_name">绑定手机号</view>
<view class="phone_tips">登录注册需绑定手机号</view>
<mobileLogin :isUp="isUp" :isShow="isShow" :platform="platform" :isPos="isPos" :appleShow="appleShow"
:authKey="authKey" @wechatPhone="wechatPhone" :wxCode="wxCode"></mobileLogin>
</view>
</view>
</template>
<script>
const app = getApp();
let statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
import sendVerifyCode from "@/mixins/SendVerifyCode";
import Routine from '@/libs/routine';
import {
loginMobile,
registerVerify,
getCodeApi,
getUserInfo,
phoneSilenceAuth,
phoneWxSilenceAuth
getUserInfo
} from "@/api/user";
import {
bindingPhone
@@ -27,10 +40,13 @@
getUserPhone
} from '@/api/public';
import mobileLogin from '@/components/login_mobile/index.vue'
export default {
name: 'login_mobile',
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
theme: app.globalData.theme,
options: '',
keyCode: '',
account: '',
@@ -41,8 +57,9 @@
isShow: false,
isPos: false,
platform: '', // 手机平台
appleShow: '' //是否是苹果登录
appleShow: '', //是否是苹果登录
statusBarHeight: statusBarHeight,
wxCode: '' //小程序code值
}
},
components: {
@@ -70,10 +87,21 @@
that.options = options
if (options.authKey) that.authKey = options.authKey
if (options.appleShow) that.appleShow = options.appleShow
if (options.code) that.wxCode = options.code
},
methods: {
// 返回
back() {
uni.navigateBack();
},
// 跳入首页
home() {
uni.switchTab({
url: '/pages/index/index'
})
},
wechatPhone() {
this.$Cache.clear('snsapiKey');
this.$Cache.clear('snsapiKey');
if (this.options.back_url) {
let url = uni.getStorageSync('snRouter');
url = url.indexOf('/pages/index/index') != -1 ? '/' : url;
@@ -129,28 +157,6 @@
close() {
this.$emit('close', false)
},
// #ifdef MP
phoneSilenceAuth(code) {
let self = this
phoneSilenceAuth({
code: code,
spid: app.globalData.spid,
spread: app.globalData.code,
phone: this.account,
captcha: this.codeNum
}).then(res => {
this.$store.commit('LOGIN', {
token: res.data.token
});
this.$store.commit("SETUID", res.data.uid);
this.getUserInfo();
}).catch(error => {
self.$util.Tips({
title: error
})
})
},
// #endif
/**
* 获取个人用户信息
*/
@@ -180,17 +186,76 @@
<style>
page {
background: #fff;
height: 100%;
}
</style>
<style lang="scss" scoped>
.wrapper {
background: #fff;
height: 100%;
position: relative;
.bag {
position: absolute;
top: 0;
left: 0;
width: 750rpx;
height: 460rpx;
@include logn-gradient(theme);
}
}
.title-bar {
position: relative;
display: flex;
align-items: center;
justify-content: center;
font-size: 36rpx;
}
.icon {
position: absolute;
left: 30rpx;
top: 0;
display: flex;
align-items: center;
justify-content: center;
width: 86rpx;
height: 86rpx;
.img {
width: 50rpx;
height: 50rpx;
}
}
.phone {
&_name {
padding: 0 72rpx;
font-size: 48rpx;
font-weight: 500;
color: #333333;
line-height: 68rpx;
margin-bottom: 16rpx;
}
&_tips {
font-size: 28rpx;
font-weight: 400;
color: #333333;
line-height: 40rpx;
padding: 0 72rpx;
}
}
.appBox {
background-color: #fff;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
overflow: hidden;
margin-top: 146rpx;
}
.shading {
@@ -263,4 +328,4 @@
text-align: center;
line-height: 90rpx;
}
</style>
</style>

View File

@@ -0,0 +1,126 @@
<template>
<view class="app_update">
<view class="logo_box">
<image :src="urlDomain+'crmebimage/perset/staticImg/crmeb_java.png'"></image>
<view class="title">crmeb</view>
<view class="version">Version {{appUpdate.versionCode}}</view>
</view>
<view class="jiancha" @click="appVersionConfig()">
<text>检查新版本</text>
<text class="iconfont icon-you"></text>
</view>
</view>
</template>
<script>
import {getAppVersion} from '@/api/api.js';
export default {
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
appUpdate:{}
}
},
onLoad() {
let that = this;
plus.runtime.getProperty(plus.runtime.appid,function(inf){
that.$set(that.appUpdate,'versionCode',inf.version);
})
},
methods: {
appVersionConfig(){
var that = this;
//app升级
// 获取本地应用资源版本号
getAppVersion().then(res=>{
that.$set(that.appUpdate,'androidAddress',res.data.androidAddress);
that.$set(that.appUpdate,'appVersion',res.data.appVersion);
that.$set(that.appUpdate,'iosAddress',res.data.iosAddress);
that.$set(that.appUpdate,'openUpgrade',res.data.openUpgrade);
plus.runtime.getProperty(plus.runtime.appid,function(inf){
let nowVersion = (inf.version).split('.').join('');
let appVersion = (res.data.appVersion).split('.').join('');
uni.getSystemInfo({
success:(res) => {
if(appVersion > nowVersion){
uni.showModal({
title: '更新提示',
content: '发现新版本,是否前去下载?',
showCancel:that.appUpdate.openUpgrade == 'false' ? true : false,
cancelColor: '#eeeeee',
confirmColor: '#FF0000',
success(response) {
if (response.confirm) {
switch (res.platform){
case "android":
plus.runtime.openURL(that.appUpdate.androidAddress);
break;
case "ios":
plus.runtime.openURL(encodeURI(that.appUpdate.iosAddress));
break;
}
}
}
});
}else if(appVersion <= nowVersion){
uni.showToast({
title:'已是最新版本',
icon:'none'
})
}
}
})
});
})
},
}
}
</script>
<style>
.app_update{
background-color: #fff;
height: 100vh;
}
.logo_box{
height: 500rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.logo_box image{
display: block;
margin-top:80rpx;
width: 120rpx;
height: 120rpx;
border-radius: 50%;
}
.title{
font-size: 34rpx;
font-family: PingFang SC;
font-weight: 600;
color: #333333;
margin: 20rpx auto 20rpx;
}
.version{
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
.jiancha{
width: 690rpx;
margin: 20rpx auto 0;
padding: 0 20rpx 0;
height: 100rpx;
line-height: 100rpx;
color: #333333;
font-size: 30rpx;
border-top:1px solid #f5f5f5;
border-bottom:1px solid #f5f5f5;
display: flex;
justify-content: space-between;
}
</style>

View File

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,27 @@
/**
* 此处可直接引用自己项目封装好的 axios 配合后端联调
*/
import request from '../utils/axios'; // 组件内部封装的axios
//import request from "@/api/axios.js" //调用项目封装的axios
/**
* 滑块验证
* @param {Object} data
*/
export function ajcaptchaCheck(data) {
return request.post("safety/check", data, {
noAuth: true
});
}
/**
* 滑块信息
* @param {Object} data
*/
export function getAjcaptcha(data) {
return request.post("safety/get", data, {
noAuth: true
});
}

View File

@@ -0,0 +1,70 @@
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import {
HTTP_REQUEST_URL,
HEADER,
TOKENNAME,
HEADERPARAMS
} from '@/config/app';
import {
toLogin,
checkLogin
} from '@/libs/login';
import store from '@/store';
/**
* 发送请求
*/
function baseRequest(url, method, data, {
noAuth = false,
noVerify = false
}, params) {
let Url = HTTP_REQUEST_URL,
header = HEADER
// if (params != undefined) {
// header = HEADERPARAMS;
// }
if (!noAuth) {
//登录过期自动登录
if (!store.state.app.token && !checkLogin()) {
toLogin();
return Promise.reject({
msg: '未登录'
});
}
}
if (store.state.app.token) header[TOKENNAME] = store.state.app.token;
return new Promise((reslove, reject) => {
uni.request({
url: Url + '/api/public/' + url,
method: method || 'GET',
header: header,
data: data || {},
success: (res) => {
reslove(res.data, res);
},
fail: (msg) => {
reject('请求失败');
}
})
});
}
const request = {};
['options', 'get', 'post', 'put', 'head', 'delete', 'trace', 'connect'].forEach((method) => {
request[method] = (api, data, opt, params) => baseRequest(api, method, data, opt || {}, params)
});
export default request;

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

@@ -1,325 +0,0 @@
<template>
<view>
<form @submit="formSubmit" report-submit='true'>
<view class='evaluate-con pad30'>
<view class='goodsStyle acea-row row-between borRadius14'>
<view class='pictrue'>
<image :src='productInfo.image'></image>
</view>
<view class='text acea-row row-between'>
<view>
<view class='name line2'>{{productInfo.storeName}}</view>
<view class='attr line1' v-if="productInfo.sku">{{productInfo.sku}}</view>
</view>
<view class='money'>
<view>{{productInfo.truePrice}}</view>
<view class='num'>x{{productInfo.cartNum}}</view>
</view>
</view>
</view>
<view class='score borRadius14'>
<view class='item acea-row row-middle' v-for="(item,indexw) in scoreList" :key="indexw">
<view>{{item.name}}</view>
<view class='starsList'>
<text @click="stars(indexn, indexw)" v-for="(itemn, indexn) in item.stars" :key="indexn" class='iconfont' :class="item.index >= indexn? 'icon-shitixing':'icon-kongxinxing'"></text>
</view>
<text class='evaluate'>{{item.index === -1 ? "" : item.index + 1 + "分"}}</text>
</view>
<view class='textarea'>
<textarea placeholder='商品满足你的期待么?说说你的想法,分享给想买的他们吧~' name="comment" placeholder-class='placeholder'></textarea>
<view class='list acea-row row-middle'>
<view class='pictrue' v-for="(item,index) in picsPath" :key="index">
<image :src='item'></image>
<text class='iconfont icon-guanbi1' @click='DelPic(index)'></text>
</view>
<view class='pictrue acea-row row-center-wrapper row-column' @click='uploadpic' v-if="picsPath.length < 8">
<text class='iconfont icon-icon25201'></text>
<view>上传图片</view>
</view>
</view>
</view>
<button class='evaluateBnt bg-color' formType="submit">立即评价</button>
</view>
</view>
</form>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
<script>
import {
orderProduct,
orderComment
} from '@/api/order.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
export default {
components: {
// #ifdef MP
authorize
// #endif
},
data() {
return {
pics: [],
picsPath: [],
scoreList: [{
name: "商品质量",
stars: ["", "", "", "", ""],
index: -1
},
{
name: "服务态度",
stars: ["", "", "", "", ""],
index: -1
}
],
orderId: '',
productId: 0, //产品id
evaluateId: 0, //评价id
unique: '',
productInfo: {},
cart_num: 0,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
id: 0//订单id
};
},
computed: mapGetters(['isLogin']),
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getOrderProduct();
}
},
deep: true
}
},
onLoad(options) {
if (!options.unique || !options.orderId ) return this.$util.Tips({
title: '缺少参数'
}, {
tab: 3,
url: 1
});
this.unique = Number(options.unique) || 0;
this.orderId = options.orderId || 0;
this.evaluateId = Number(options.id) || 0;
if (this.isLogin) {
this.getOrderProduct();
} else {
toLogin();
}
},
methods: {
onLoadFun() {
this.getOrderProduct();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
/**
* 获取某个产品详情
*
*/
getOrderProduct: function() {
let that = this;
orderProduct({
orderId: that.evaluateId,
uni: that.unique
}).then(res => {
that.$set(that, 'productInfo', res.data);
// that.$set(that, 'cart_num', res.data.cartNum);
// that.$set(that, 'productId', res.data.productId);
});
},
stars: function(indexn, indexw) {
this.scoreList[indexw].index = indexn;
},
/**
* 删除图片
*
*/
DelPic: function(index) {
let that = this,
pic = this.picsPath[index];
that.picsPath.splice(index, 1);
that.pics.splice(index, 1);
},
/**
* 上传文件
*
*/
uploadpic: function() {
let that = this;
that.$util.uploadImageOne({
url: 'user/upload/image',
name: 'multipart',
model: "product",
pid: 1
}, function(res) {
that.pics.push(res.data.url);
that.picsPath.push(res.data.localPath);
that.$set(that, 'pics', that.pics);
that.$set(that, 'picsPath', that.picsPath);
});
},
/**
* 立即评价
*/
formSubmit: function(e) {
let formId = e.detail.formId,
value = e.detail.value,
that = this,
product_score = that.scoreList[0].index + 1 === 0 ? "" : that.scoreList[0].index + 1,
service_score = that.scoreList[1].index + 1 === 0 ? "" : that.scoreList[1].index + 1;
if (!value.comment) return that.$util.Tips({
title: '请填写你对宝贝的心得!'
});
value.productScore = product_score;
value.serviceScore = service_score;
value.pics = that.pics.length>0?JSON.stringify(that.pics):'';
value.productId = that.productInfo.productId;
value.orderNo = that.orderId;
value.unique = that.unique;
value.sku = that.productInfo.sku;
uni.showLoading({
title: "正在发布评论……"
});
orderComment(value).then(res => {
uni.hideLoading();
return that.$util.Tips({
title: '感谢您的评价!',
icon: 'success'
}, '/pages/order_details/index?order_id=' + that.orderId);
}).catch(err => {
uni.hideLoading();
return that.$util.Tips({
title: err
});
});
}
}
}
</script>
<style lang="scss" scoped>
.goodsStyle .text .name, .attr{
//width: 496rpx;
}
.icon-shitixing{
color: #FFBB00 !important;
}
.evaluate-con .score {
background-color: #fff;
// border-top: 1rpx solid #f5f5f5;
margin-top: 20rpx;
font-size: 28rpx;
color: #282828;
padding: 46rpx 24rpx;
}
.evaluate-con .score .item~.item {
margin-top: 36rpx;
}
.evaluate-con .score .item .starsList {
padding: 0 35rpx 0 40rpx;
}
.evaluate-con .score .item .starsList .iconfont {
font-size: 40rpx;
color: #aaa;
}
.evaluate-con .score .item .starsList .iconfont~.iconfont {
margin-left: 20rpx;
}
.evaluate-con .score .item .evaluate {
color: #aaa;
font-size: 24rpx;
}
.evaluate-con .score .textarea {
width: 100%;
background-color: #F5F5F5;
border-radius: 14rpx;
margin-top: 55rpx;
}
.evaluate-con .score .textarea textarea {
font-size: 28rpx;
padding: 38rpx 30rpx 0 30rpx;
width: 100%;
box-sizing: border-box;
height: 160rpx;
width: auto !important;
}
.evaluate-con .score .textarea .placeholder {
color: #bbb;
}
.evaluate-con .score .textarea .list {
margin-top: 25rpx;
padding-left: 5rpx;
}
.evaluate-con .score .textarea .list .pictrue {
width: 140rpx;
height: 140rpx;
margin: 0 0 35rpx 25rpx;
position: relative;
font-size: 22rpx;
color: #bbb;
border-radius: 14rpx;
}
.evaluate-con .score .textarea .list .pictrue:nth-last-child(1) {
border: 1rpx solid #ddd;
box-sizing: border-box;
}
.evaluate-con .score .textarea .list .pictrue image {
width: 100%;
height: 100%;
border-radius: 14rpx;
}
.evaluate-con .score .textarea .list .pictrue .icon-guanbi1 {
font-size: 45rpx;
position: absolute;
top: -20rpx;
right: -20rpx;
}
.evaluate-con .score .textarea .list .pictrue .icon-icon25201 {
color: #bfbfbf;
font-size: 50rpx;
}
.evaluate-con .score .evaluateBnt {
font-size: 30rpx;
color: #fff;
width: 100%;
height: 86rpx;
border-radius: 43rpx;
text-align: center;
line-height: 86rpx;
margin-top: 45rpx;
}
</style>

View File

@@ -1,183 +0,0 @@
<template>
<view style="height: 100%;">
<view class='evaluate-list'>
<view class='generalComment acea-row row-between-wrapper'>
<view class='acea-row row-middle font-color'>
<view class='evaluate'>评分</view>
<view class='start'
:class="'star'+ (replyData.sumCount===0?'3':Math.round(replyData.replyStar/replyData.sumCount))">
</view>
</view>
<view><text class='font-color'>{{(replyData.replyChance)*100}}%</text>好评率</view>
</view>
<view class='nav acea-row row-middle'>
<view class='item' :class='type==0 ? "bg-color":""' @click='changeType(0)'>全部({{replyData.sumCount}})
</view>
<view class='item' :class='type==1 ? "bg-color":""' @click='changeType(1)'>好评({{replyData.goodCount}})
</view>
<view class='item' :class='type==2 ? "bg-color":""' @click='changeType(2)'>中评({{replyData.inCount}})
</view>
<view class='item' :class='type==3 ? "bg-color":""' @click='changeType(3)'>差评({{replyData.poorCount}})
</view>
</view>
<userEvaluation :reply="reply"></userEvaluation>
</view>
<view class='loadingicon acea-row row-center-wrapper'>
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view>
<view class='noCommodity' v-if="!replyData.sumCount && page > 1">
<view class='pictrue'>
<image src='../static/noEvaluate.png'></image>
</view>
</view>
</view>
</template>
<script>
import {
getReplyList,
getReplyConfig
} from '@/api/store.js';
import userEvaluation from '@/components/userEvaluation';
export default {
components: {
userEvaluation
},
data() {
return {
replyData: {},
product_id: 0,
reply: [],
type: 0,
loading: false,
loadend: false,
loadTitle: '加载更多',
page: 1,
limit: 20
};
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let that = this;
if (!options.productId) return that.$util.Tips({
title: '缺少参数'
}, {
tab: 3,
url: 1
});
that.productId = options.productId;
},
onShow: function() {
this.getProductReplyCount();
this.getProductReplyList();
},
methods: {
/**
* 获取评论统计数据
*
*/
getProductReplyCount: function() {
let that = this;
getReplyConfig(that.productId).then(res => {
that.$set(that, 'replyData', res.data);
});
},
/**
* 分页获取评论
*/
getProductReplyList: function() {
let that = this;
if (that.loadend) return;
if (that.loading) return;
that.loading = true;
that.loadTitle = '';
getReplyList(that.productId, {
page: that.page,
limit: that.limit,
type: that.type,
}).then(res => {
let list = res.data.list,
loadend = list.length < that.limit;
that.reply = that.$util.SplitArray(list, that.reply);
that.$set(that, 'reply', that.reply);
that.loading = false;
that.loadend = loadend;
if (that.reply.length) {
that.loadTitle = loadend ? "😕人家是有底线的~~" : "加载更多";
}
that.page = that.page + 1;
}).catch(err => {
that.loading = false,
that.loadTitle = '加载更多'
});
},
/*
* 点击事件切换
* */
changeType: function(e) {
let type = parseInt(e);
if (type == this.type) return;
this.type = type;
this.page = 1;
this.loadend = false;
this.$set(this, 'reply', []);
this.getProductReplyList();
}
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
this.getProductReplyList();
},
}
</script>
<style lang="scss">
page {
background-color: #fff;
height: 100%;
}
.evaluate-list{
padding: 30rpx 0 0 0;
background-color: #fff;
}
.evaluate-list .generalComment {
padding: 0 30rpx;
margin-top: 1rpx;
background-color: #fff;
font-size: 28rpx;
color: #808080;
}
.evaluate-list .generalComment .evaluate {
margin-right: 7rpx;
color: #333333;
font-size: 28rpx;
}
.evaluate-list .nav {
font-size: 24rpx;
color: #282828;
padding: 30rpx;
background-color: #fff;
border-bottom: 1rpx solid #f5f5f5;
}
.evaluate-list .nav .item {
font-size: 24rpx;
color: #282828;
border-radius: 27rpx;
height: 54rpx;
padding: 0 20rpx;
background-color: #f4f4f4;
line-height: 54rpx;
margin-right: 17rpx;
}
.evaluate-list .nav .item.bg-color {
color: #fff;
}
</style>

View File

@@ -1,300 +0,0 @@
<template>
<div>
<div class="storeBox" ref="container">
<div class="storeBox-box" v-for="(item, index) in storeList" :key="index" @click.stop="checked(item)">
<div class="store-img"><img :src="item.image" lazy-load="true" /></div>
<div class="store-cent-left">
<div class="store-name">{{ item.name }}</div>
<div class="store-address line1">
{{ item.address }}{{ ", " + item.detailedAddress }}
</div>
</div>
<div class="row-right">
<div>
<!-- #ifdef H5 -->
<a class="store-phone" :href="'tel:' + item.phone"><span
class="iconfont icon-dadianhua01"></span></a>
<!-- #endif -->
<!-- #ifdef MP -->
<view class="store-phone" @click="call(item.phone)"><text
class="iconfont icon-dadianhua01"></text></view>
<!-- #endif -->
</div>
<!-- <div>
<a class="store-phone" :href="'tel:' + item.phone"><span class="iconfont icon-dadianhua01"></span></a>
</div> -->
<div class="store-distance" @click.stop="showMaoLocation(item)">
<span class="addressTxt" v-if="item.distance">距离{{ item.distance/1000 }}千米</span>
<span class="addressTxt" v-else>查看地图</span>
<span class="iconfont icon-youjian"></span>
</div>
</div>
</div>
<Loading :loaded="loaded" :loading="loading"></Loading>
</div>
<div>
<!-- <iframe v-if="locationShow && !isWeixin" ref="geoPage" width="0" height="0" frameborder="0" style="display:none;"
scrolling="no" :src="
'https://apis.map.qq.com/tools/geolocation?key=' +
mapKey +
'&referer=myapp'
">
</iframe> -->
</div>
</div>
</template>
<script>
import Loading from "@/components/Loading";
import {
storeListApi
} from "@/api/store";
import {
isWeixin
} from "@/utils/index";
// #ifdef H5
import {
wechatEvevt,
wxShowLocation
} from "@/libs/wechat";
// #endif
import {
mapGetters
} from "vuex";
// import cookie from "@/utils/store/cookie";
const LONGITUDE = "user_longitude";
const LATITUDE = "user_latitude";
const MAPKEY = "mapKey";
export default {
name: "storeList",
components: {
Loading
},
// computed: mapGetters(["goName"]),
data() {
return {
page: 1,
limit: 20,
loaded: false,
loading: false,
storeList: [],
system_store: {},
// mapKey: cookie.get(MAPKEY),
locationShow: false,
user_latitude: 0,
user_longitude: 0
};
},
onLoad() {
try {
this.user_latitude = uni.getStorageSync('user_latitude');
this.user_longitude = uni.getStorageSync('user_longitude');
} catch (e) {
// error
}
},
mounted() {
if (this.user_latitude && this.user_longitude) {
this.getList();
} else {
this.selfLocation();
this.getList();
}
// this.$scroll(this.$refs.container, () => {
// !this.loading && this.getList();
// });
},
methods: {
call(phone) {
uni.makePhoneCall({
phoneNumber: phone,
});
},
selfLocation() {
let self = this
// #ifdef H5
if (self.$wechat.isWeixin()) {
self.$wechat.location().then(res => {
this.user_latitude = res.latitude;
this.user_longitude = res.longitude;
uni.setStorageSync('user_latitude', res.latitude);
uni.setStorageSync('user_longitude', res.longitude);
self.getList();
})
} else {
// #endif
uni.getLocation({
type: 'wgs84',
success: (res) => {
try {
this.user_latitude = res.latitude;
this.user_longitude = res.longitude;
uni.setStorageSync('user_latitude', res.latitude);
uni.setStorageSync('user_longitude', res.longitude);
} catch {}
self.getList();
},
complete: function() {
self.getList();
}
});
// #ifdef H5
}
// #endif
},
showMaoLocation(e) {
let self = this;
// #ifdef H5
if (self.$wechat.isWeixin()) {
self.$wechat.seeLocation({
latitude: Number(e.latitude),
longitude: Number(e.longitude)
}).then(res => {
console.log('success');
})
} else {
// #endif
uni.openLocation({
latitude: Number(e.latitude),
longitude: Number(e.longitude),
name: e.name,
address: `${e.address}-${e.detailedAddress}`,
success: function() {
console.log('success');
}
});
// #ifdef H5
}
// #endif
},
// 选中门店
checked(e) {
uni.$emit("handClick", {
address: e
});
uni.navigateBack();
// if (this.goName === "orders") {
// this.$store.commit("GET_STORE", e);
// this.$router.go(-1); //返回上一层
// }
},
// 获取门店列表数据
getList: function() {
if (this.loading || this.loaded) return;
this.loading = true;
let data = {
latitude: this.user_latitude || "", //纬度
longitude: this.user_longitude || "", //经度
page: this.page,
limit: this.limit
};
storeListApi(data)
.then(res => {
this.loading = false;
this.loaded = res.data.list.length < this.limit;
this.storeList.push.apply(this.storeList, res.data.list);
this.page = this.page + 1;
})
.catch(err => {
this.$dialog.error(err);
});
}
},
onReachBottom() {
this.getList();
}
};
</script>
<style>
.geoPage {
position: fixed;
width: 100%;
height: 100%;
top: 0;
z-index: 10000;
}
.storeBox {
width: 100%;
background-color: #fff;
padding: 0 30rpx;
}
.storeBox-box {
width: 100%;
height: auto;
display: flex;
align-items: center;
padding: 23rpx 0;
justify-content: space-between;
border-bottom: 1px solid #eee;
}
.store-cent {
display: flex;
align-items: center;
width: 80%;
}
.store-cent-left {
width: 45%;
}
.store-img {
width: 120rpx;
height: 120rpx;
border-radius: 6rpx;
margin-right: 22rpx;
}
.store-img img {
width: 100%;
height: 100%;
}
.store-name {
color: #282828;
font-size: 30rpx;
margin-bottom: 22rpx;
font-weight: 800;
}
.store-address {
color: #666666;
font-size: 24rpx;
}
.store-phone {
width: 50rpx;
height: 50rpx;
color: #fff;
border-radius: 50%;
display: block;
text-align: center;
line-height: 48rpx;
background-color: #e83323;
margin-bottom: 22rpx;
text-decoration: none;
}
.store-distance {
font-size: 22rpx;
color: #e83323;
}
.iconfont {
font-size: 20rpx;
}
.row-right {
display: flex;
flex-direction: column;
align-items: flex-end;
width: 33.5%;
}
</style>

View File

@@ -1,300 +0,0 @@
<template>
<view>
<view class='logistics'>
<view class='header acea-row row-between row-top'>
<view class='pictrue'>
<image :src='product.productImg'></image>
</view>
<view class='text acea-row row-between'>
<view class='name line2'>{{product.productName}}</view>
<view class='money'>
<view>{{product.price}}</view>
<view>x{{product.payNum}}</view>
</view>
</view>
</view>
<view class='logisticsCon'>
<view class='company acea-row row-between-wrapper'>
<view class='picTxt acea-row row-between-wrapper'>
<view class='iconfont icon-wuliu'></view>
<view class='text'>
<view><text class='name line1'>物流公司</text> {{orderInfo.deliveryName}}</view>
<view class='express line1'><text class='name'>快递单号</text> {{orderInfo.deliveryId}}</view>
</view>
</view>
<!-- #ifndef H5 -->
<view class='copy' @tap='copyOrderId'>复制单号</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<view class='copy copy-data' :data-clipboard-text="orderInfo.deliveryId">复制单号</view>
<!-- #endif -->
</view>
<view class='item' v-for="(item,index) in expressList" :key="index">
<view class='circular' :class='index === 0 ? "on":""'></view>
<view class='text' :class='index===0 ? "on-font on":""'>
<view>{{item.status}}</view>
<view class='data' :class='index===0 ? "on-font on":""'>{{item.time}}</view>
</view>
</view>
</view>
<recommend :hostProduct='hostProduct' v-if="hostProduct.length"></recommend>
</view>
<!-- #ifdef MP -->
<!-- <authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
<script>
import {
express
} from '@/api/order.js';
import {
getProductHot
} from '@/api/store.js';
import ClipboardJS from "@/plugin/clipboard/clipboard.js";
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
import recommend from '@/components/recommend';
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
export default {
components: {
recommend,
// #ifdef MP
authorize
// #endif
},
data() {
return {
orderId: '',
product: {
productInfo: {}
},
orderInfo: {},
expressList: [],
hostProduct: [],
loading: false,
goodScroll: true,
params: { //精品推荐分页
page: 1,
limit: 10,
},
};
},
computed: mapGetters(['isLogin']),
watch:{
isLogin:{
handler:function(newV,oldV){
if(newV){
this.getExpress();
this.get_host_product();
}
},
deep:true
}
},
onLoad: function (options) {
if (!options.orderId) return this.$util.Tips({title:'缺少订单号'});
this.orderId = options.orderId;
if (this.isLogin) {
this.getExpress();
this.get_host_product();
} else {
toLogin();
}
},
onReady: function() {
// #ifdef H5
this.$nextTick(function() {
const clipboard = new ClipboardJS(".copy-data");
clipboard.on("success", () => {
this.$util.Tips({
title: '复制成功'
});
});
});
// #endif
},
methods: {
/**
* 授权回调
*/
onLoadFun: function() {
this.getExpress();
this.get_host_product();
},
copyOrderId:function(){
uni.setClipboardData({ data: this.orderInfo.deliveryId });
},
getExpress:function(){
let that=this;
express(that.orderId).then(function(res){
let result = res.data.express|| {};
that.$set(that,'product',res.data.order.info[0] || {});
that.$set(that,'orderInfo',res.data.order);
that.$set(that,'expressList',result.list || []);
});
},
get_host_product: function () {
this.loading = true
if (!this.goodScroll) return
let that = this;
getProductHot(that.params.page,that.params.limit).then(function (res) {
//this.iSshowH = false
that.loading = false
that.goodScroll = res.data.list.length >= that.params.limit
that.params.page++
that.hostProduct = that.hostProduct.concat(res.data.list)
});
},
},
// 滚动到底部
onReachBottom() {
if (this.params.page != 1) {
this.get_host_product();
}
},
}
</script>
<style scoped lang="scss">
.logistics .header {
padding: 23rpx 30rpx;
background-color: #fff;
height: 166rpx;
box-sizing: border-box;
}
.logistics .header .pictrue {
width: 120rpx;
height: 120rpx;
}
.logistics .header .pictrue image {
width: 100%;
height: 100%;
border-radius: 6rpx;
}
.logistics .header .text {
width: 540rpx;
font-size: 28rpx;
color: #999;
margin-top: 6rpx;
}
.logistics .header .text .name {
width: 365rpx;
color: #282828;
}
.logistics .header .text .money {
text-align: right;
}
.logistics .logisticsCon {
background-color: #fff;
margin: 12rpx 0;
}
.logistics .logisticsCon .company {
height: 120rpx;
margin: 0 0 45rpx 30rpx;
padding-right: 30rpx;
border-bottom: 1rpx solid #f5f5f5;
}
.logistics .logisticsCon .company .picTxt {
width: 520rpx;
}
.logistics .logisticsCon .company .picTxt .iconfont {
width: 50rpx;
height: 50rpx;
background-color: #666;
text-align: center;
line-height: 50rpx;
color: #fff;
font-size: 35rpx;
}
.logistics .logisticsCon .company .picTxt .text {
width: 450rpx;
font-size: 26rpx;
color: #282828;
}
.logistics .logisticsCon .company .picTxt .text .name {
color: #999;
}
.logistics .logisticsCon .company .picTxt .text .express {
margin-top: 5rpx;
}
.logistics .logisticsCon .company .copy {
font-size: 20rpx;
width: 106rpx;
height: 40rpx;
text-align: center;
line-height: 40rpx;
border-radius: 20rpx;
border: 1rpx solid #999;
}
.logistics .logisticsCon .item {
padding: 0 40rpx;
position: relative;
}
.logistics .logisticsCon .item .circular {
width: 20rpx;
height: 20rpx;
border-radius: 50%;
position: absolute;
top: -1rpx;
left: 31.5rpx;
background-color: #ddd;
}
.logistics .logisticsCon .item .circular.on {
background-color: $theme-color;
}
.logistics .logisticsCon .item .text.on-font {
color: $theme-color;
}
.logistics .logisticsCon .item .text .data.on-font {
color: $theme-color;
}
.logistics .logisticsCon .item .text {
font-size: 26rpx;
color: #666;
width: 615rpx;
border-left: 1rpx solid #e6e6e6;
padding: 0 0 60rpx 38rpx;
}
.logistics .logisticsCon .item .text.on {
border-left-color: #f8c1bd;
}
.logistics .logisticsCon .item .text .data {
font-size: 24rpx;
color: #999;
margin-top: 10rpx;
}
.logistics .logisticsCon .item .text .data .time {
margin-left: 15rpx;
}
</style>

View File

@@ -1,204 +0,0 @@
<template>
<view>
<form @submit="subRefund" report-submit='true'>
<view class='apply-return'>
<view class='goodsStyle acea-row row-between borRadius14' v-for="(item,index) in orderInfo.orderInfoList" :key="index">
<view class='pictrue'><image :src='item.image'></image></view>
<view class='text acea-row row-between'>
<view class='name line2'>{{item.storeName}}</view>
<view class='money'>
<view>{{item.price}}</view>
<view class='num'>x{{item.cartNum}}</view>
</view>
</view>
</view>
<view class='list borRadius14'>
<view class='item acea-row row-between-wrapper'>
<view>退货件数</view>
<view class='num'>{{orderInfo.totalNum}}</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view>退款金额</view>
<view class='num'>{{orderInfo.payPrice}}</view>
</view>
<view class='item acea-row row-between-wrapper' @tap="toggleTab('region')">
<view>退款原因</view>
<picker class='num' @change="bindPickerChange" :value="index" :range="RefundArray">
<view class="picker acea-row row-between-wrapper">
<view class='reason'>{{RefundArray[index]}}</view>
<text class='iconfont icon-jiantou'></text>
</view>
</picker>
</view>
<view class='item textarea acea-row row-between'>
<view>备注说明</view>
<textarea placeholder='填写备注信息100字以内' class='num' name="refund_reason_wap_explain" placeholder-class='填写备注信息100字以内'></textarea>
</view>
<view class='item acea-row row-between' style="border: none;">
<view class='title acea-row row-between-wrapper'>
<view>上传凭证</view>
<view class='tip'>( 最多可上传3张 )</view>
</view>
<view class='upload acea-row row-middle'>
<view class='pictrue' v-for="(item,index) in refund_reason_wap_imgPath" :key="index">
<image :src='item'></image>
<view class='iconfont icon-guanbi1 font-color' @tap='DelPic(index)'></view>
</view>
<view class='pictrue acea-row row-center-wrapper row-column' @tap='uploadpic' v-if="refund_reason_wap_imgPath.length < 3">
<text class='iconfont icon-icon25201'></text>
<view>上传凭证</view>
</view>
</view>
</view>
<button class='returnBnt bg-color' form-type="submit">申请退款</button>
</view>
</view>
</form>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
<script>
import { ordeRefundReason, orderRefundVerify, applyRefund} from '@/api/order.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
export default {
components: {
// #ifdef MP
authorize
// #endif
},
data() {
return {
refund_reason_wap_img:[],
refund_reason_wap_imgPath:[],
orderInfo:{},
RefundArray: [],
index: 0,
orderId:0,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
};
},
computed: mapGetters(['isLogin']),
watch:{
isLogin:{
handler:function(newV,oldV){
if(newV){
this.getOrderInfo();
this.getRefundReason();
}
},
deep:true
}
},
onLoad: function (options) {
if (!options.orderId) return this.$util.Tips({title:'缺少订单id,无法退款'},{tab:3,url:1});
this.orderId = options.orderId;
if (this.isLogin) {
this.getOrderInfo();
this.getRefundReason();
} else {
toLogin();
}
},
methods: {
onLoadFun:function(){
this.getOrderInfo();
this.getRefundReason();
},
/**
* 获取订单详情
*
*/
getOrderInfo:function(){
let that=this;
applyRefund(that.orderId).then(res=>{
that.$set(that,'orderInfo',res.data);
});
},
/**
* 获取退款理由
*/
getRefundReason:function(){
let that=this;
ordeRefundReason().then(res=>{
that.$set(that,'RefundArray',res.data);
})
},
/**
* 删除图片
*
*/
DelPic:function(e){
let index = e, that = this;
that.refund_reason_wap_imgPath.splice(index, 1);
},
/**
* 上传文件
*
*/
uploadpic:function(){
let that=this;
that.$util.uploadImageOne({url:'user/upload/image',name:'multipart', model:"product", pid:1}, function(res){
that.refund_reason_wap_imgPath.push(res.data.url);
});
},
/**
* 申请退货
*/
subRefund:function(e){
let that = this, value = e.detail.value;
//收集form表单
// if (!value.refund_reason_wap_explain) return this.$util.Tips({title:'请输入退款原因'});
orderRefundVerify({
text: that.RefundArray[that.index] || '',
refund_reason_wap_explain: value.refund_reason_wap_explain,
refund_reason_wap_img: that.refund_reason_wap_imgPath.join(','),
uni: that.orderId
}).then(res=>{
return this.$util.Tips({ title: '申请成功', icon: 'success' }, { tab: 5, url: '/pages/users/user_return_list/index?isT=1' });
}).catch(err=>{
return this.$util.Tips({ title: err });
})
},
bindPickerChange: function (e) {
this.$set(this,'index',e.detail.value);
}
}
}
</script>
<style scoped lang="scss">
.apply-return{
padding: 20rpx 30rpx 70rpx 30rpx;
}
.apply-return .list{background-color:#fff;margin-top:18rpx;padding:0 24rpx 70rpx 24rpx;}
.apply-return .list .item{min-height:90rpx;border-bottom:1rpx solid #eee;font-size:30rpx;color:#333;}
.apply-return .list .item .num{color:#282828;width:427rpx;text-align:right;}
.apply-return .list .item .num .picker .reason{width:385rpx;}
.apply-return .list .item .num .picker .iconfont{color:#666;font-size:30rpx;margin-top:2rpx;}
.apply-return .list .item.textarea{padding:24rpx 0;}
.apply-return .list .item textarea{height:100rpx;font-size:30rpx;}
.apply-return .list .item .placeholder{color:#bbb;}
.apply-return .list .item .title{height:95rpx;width:100%;}
.apply-return .list .item .title .tip{font-size:30rpx;color:#bbb;}
.apply-return .list .item .upload{padding-bottom:36rpx;}
.apply-return .list .item .upload .pictrue{border-radius: 14rpx; margin:22rpx 23rpx 0 0;width:156rpx;height:156rpx;position:relative;font-size:24rpx;color:#bbb;}
.apply-return .list .item .upload .pictrue:nth-of-type(4n){margin-right:0;}
.apply-return .list .item .upload .pictrue image{width:100%;height:100%;border-radius:14rpx;}
.apply-return .list .item .upload .pictrue .icon-guanbi1{position:absolute;font-size:45rpx;top:-10rpx;right:-10rpx;}
.apply-return .list .item .upload .pictrue .icon-icon25201{color:#bfbfbf;font-size:50rpx;}
.apply-return .list .item .upload .pictrue:nth-last-child(1){border:1rpx solid #ddd;box-sizing:border-box;}
.apply-return .returnBnt{font-size:32rpx;color:#fff;width:100%;height:86rpx;border-radius:50rpx;text-align:center;line-height:86rpx;margin:43rpx auto;}
</style>

View File

@@ -1,23 +1,21 @@
<template>
<div class="login-wrapper">
<div class="login-wrapper" :data-theme="theme">
<div class="shading">
<!-- <image :src="logoUrl"/> -->
<image :src="logoUrl"/>
<!-- <image src="/static/images/logo2.png" v-if="!logoUrl" /> -->
<image :src="mobileLoginLogo"/>
</div>
<div class="whiteBg" v-if="formItem === 1">
<div class="list" v-if="current !== 1">
<form @submit.prevent="submit">
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/phone_1.png" style="width: 24rpx; height: 34rpx;"></image>
<input type="text" class="texts" placeholder="输入手机号码" v-model="account" required/>
<image :src="urlDomain+'crmebimage/perset/staticImg/phone_1.png'" style="width: 24rpx; height: 34rpx;"></image>
<input type="number" class="texts" placeholder="输入手机号码" v-model="account" maxlength="11" required/>
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx;"></image>
<input type="password" class="texts" placeholder="填写登录密码" v-model="password" required />
<image :src="urlDomain+'crmebimage/perset/staticImg/code_2.png'" style="width: 28rpx; height: 32rpx;"></image>
<input type="password" class="texts" placeholder="填写登录密码" maxlength="18" v-model="password" required />
</div>
</div>
</form>
@@ -25,40 +23,68 @@
<div class="list" v-if="current !== 0 || appLoginStatus || appleLoginStatus">
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/phone_1.png" style="width: 24rpx; height: 34rpx;"></image>
<input type="text" class="texts" placeholder="输入手机号码" v-model="account" />
<image :src="urlDomain+'crmebimage/perset/staticImg/phone_1.png'" style="width: 24rpx; height: 34rpx;"></image>
<input type="number" class="texts" placeholder="输入手机号码" v-model="account" maxlength="11"/>
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx;"></image>
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
<image :src="urlDomain+'crmebimage/perset/staticImg/code_2.png'" style="width: 28rpx; height: 32rpx;"></image>
<input type="number" placeholder="填写验证码" class="codeIput" v-model="captcha" maxlength="6" />
<button class="code main_color" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
{{ text }}
</button>
</div>
</div>
<div class="item" v-if="isShowCode">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx;"></image>
<input type="text" placeholder="填写验证码" class="codeIput" v-model="codeVal" />
<image :src="urlDomain+'crmebimage/perset/staticImg/code_2.png'" style="width: 28rpx; height: 32rpx;"></image>
<input type="number" placeholder="填写验证码" class="codeIput" v-model="codeVal" maxlength="6"/>
<div class="code" @click="again"><img :src="codeUrl" /></div>
</div>
</div>
</div>
<div class="logon" @click="loginMobile" v-if="current !== 0">登录</div>
<div class="logon" @click="submit" v-if="current === 0">登录</div>
<div class="logon bg_color" @click="loginMobile" v-if="current !== 0">登录</div>
<div class="logon bg_color" @click="submit" v-if="current === 0">登录</div>
<!-- #ifndef APP-PLUS -->
<div class="tips">
<div v-if="current==0" @click="current = 1">快速登录</div>
<div v-if="current==1" @click="current = 0">账号登录</div>
</div>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<view class="appLogin" v-if="!appLoginStatus && !appleLoginStatus">
<view class="hds">
<span class="line"></span>
<p>其他方式登录</p>
<span class="line"></span>
</view>
<view class="btn-wrapper">
<view class="btn wx" @click="wxLogin">
<span class="iconfont icon-s-weixindenglu1"></span>
</view>
<view class="btn mima" v-if="current == 1" @click="current =0">
<span class="iconfont icon-s-mimadenglu1"></span>
</view>
<view class="btn yanzheng" v-if="current == 0" @click="current =1">
<span class="iconfont icon-s-yanzhengmadenglu1"></span>
</view>
<!-- <view class="btn apple-btn" @click="appleLogin" v-if="appleShow">
<view class="iconfont icon-s-pingguo"></view>
</view> -->
</view>
</view>
<!-- #endif -->
</div>
<div class="bottom"></div>
<Verify @success="handlerOnVerSuccess" :captchaType="'clickWord'" :imgSize="{ width: '330px', height: '155px' }"
ref="verify"></Verify>
</div>
</template>
<script>
import dayjs from "@/plugin/dayjs/dayjs.min.js";
import sendVerifyCode from "@/mixins/SendVerifyCode";
import Verify from '../components/verifition/verify.vue';
import {
loginH5,
loginMobile,
@@ -67,28 +93,27 @@
// getCodeApi,
getUserInfo
} from "@/api/user";
import attrs, {
required,
alpha_num,
chs_phone
} from "@/utils/validate";
let app = getApp();
import attrs, {required,alpha_num,chs_phone} from "@/utils/validate";
import {validatorDefaultCatch} from "@/utils/dialog";
import {appAuth} from "@/api/public";
import {VUE_APP_API_URL} from "@/utils";
import Routine from '@/libs/routine';
import {Debounce} from '@/utils/validate.js'
import {
validatorDefaultCatch
} from "@/utils/dialog";
import {
getLogo, appAuth, appleLogin
} from "@/api/public";
import {
VUE_APP_API_URL
} from "@/utils";
goToAgreement
} from "@/libs/order";
const BACK_URL = "login_back_url";
export default {
name: "Login",
mixins: [sendVerifyCode],
components: {
Verify,
},
data: function() {
return {
urlDomain: this.$Cache.get("imgHost"),
navList: ["快速登录", "账号登录"],
current: 1,
account: "",
@@ -96,7 +121,6 @@
captcha: "",
formItem: 1,
type: "login",
logoUrl: "",
keyCode: "",
codeUrl: "",
codeVal: "",
@@ -106,7 +130,9 @@
appUserInfo: null, // 微信登录保存的用户信息
appleLoginStatus: false, // 苹果登录强制绑定手机号码状态
appleUserInfo: null,
appleShow: false // 苹果登录版本必须要求ios13以上的
appleShow: false ,// 苹果登录版本必须要求ios13以上的
theme:app.globalData.theme,
mobileLoginLogo: app.globalData.mobileLoginLogo // 登录页logo
};
},
watch:{
@@ -119,92 +145,120 @@
}
},
mounted: function() {
this.getCode();
this.getLogoImage();
},
onLoad() {
let self = this
uni.getSystemInfo({
success: function(res) {
if (res.platform.toLowerCase() == 'ios' && res.system.split(' ')[1] >= 13) {
if (res.platform.toLowerCase() == 'ios' && res.system.split(' ')[1] >= '13') {
self.appleShow = true
}
}
});
},
methods: {
// 苹果登录
appleLogin() {
let self = this
this.account = ''
this.captcha = ''
uni.showLoading({
title: '登录中'
})
uni.login({
provider: 'apple',
timeout: 10000,
success(loginRes) {
uni.getUserInfo({
provider: 'apple',
success: function(infoRes) {
self.appleUserInfo = infoRes.userInfo
self.appleLoginApi()
},
fail() {
uni.hideLoading()
uni.showToast({
title: '获取用户信息失败',
icon: 'none',
duration: 2000
})
},
complete() {
uni.hideLoading()
}
//滑块验证成功后
handlerOnVerSuccess(data) {
this.$refs.verify.hide();
this.codeSend();
},
//发送验证码
codeSend() {
let that = this;
if (!that.account) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
registerVerify(that.account)
.then(res => {
that.$util.Tips({
title: res.message
});
},
fail(error) {
uni.hideLoading()
console.log(error)
}
})
that.sendCode();
})
.catch(err => {
return that.$util.Tips({
title: err
});
});
},
userAgree(type) {
goToAgreement(type)
},
// 苹果登录
// appleLogin() {
// let self = this
// this.account = ''
// this.captcha = ''
// uni.showLoading({
// title: '登录中'
// })
// uni.login({
// provider: 'apple',
// timeout: 10000,
// success(loginRes) {
// uni.getUserInfo({
// provider: 'apple',
// success: function(infoRes) {
// self.appleUserInfo = infoRes.userInfo
// self.appleLoginApi()
// },
// fail() {
// uni.hideLoading()
// uni.showToast({
// title: '获取用户信息失败',
// icon: 'none',
// duration: 2000
// })
// },
// complete() {
// uni.hideLoading()
// }
// });
// },
// fail(error) {
// uni.hideLoading()
// console.log(error)
// }
// })
// },
// 苹果登录Api
appleLoginApi() {
let self = this
appleLogin({
openId: self.appleUserInfo.openId,
email: self.appleUserInfo.email == undefined ? '' :self.appleUserInfo.email,
identityToken: self.appleUserInfo.identityToken || ''
}).then((res) => {
this.$store.commit("LOGIN", {
'token': res.data.token
});
this.getUserInfo(res.data);
}).catch(error => {
uni.hideLoading();
uni.showModal({
title: '提示',
content: `错误信息${error}`,
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
})
},
// appleLoginApi() {
// let self = this
// appleLogin({
// openId: self.appleUserInfo.openId,
// email: self.appleUserInfo.email == undefined ? '' :self.appleUserInfo.email,
// identityToken: self.appleUserInfo.identityToken || ''
// }).then((res) => {
// this.$store.commit("LOGIN", {
// 'token': res.data.token
// });
// this.getUserInfo(res.data);
// }).catch(error => {
// uni.hideLoading();
// uni.showModal({
// title: '提示',
// content: `错误信息${error}`,
// success: function(res) {
// if (res.confirm) {
// console.log('用户点击确定');
// } else if (res.cancel) {
// console.log('用户点击取消');
// }
// }
// });
// })
// },
// App微信登录
wxLogin() {
wxLogin:Debounce(function() {
let self = this
this.account = ''
this.captcha = ''
uni.showLoading({
title: '登录中'
})
})
uni.login({
provider: 'weixin',
success: function(loginRes) {
@@ -216,7 +270,7 @@
self.appUserInfo = infoRes.userInfo
self.appUserInfo.type = self.platform === 'ios' ? 'iosWx' : 'androidWx'
self.wxLoginGo(self.appUserInfo)
},
},
fail() {
uni.hideLoading();
uni.showToast({
@@ -239,7 +293,7 @@
})
}
});
},
}),
wxLoginGo(userInfo) {
appAuth(userInfo).then(res => {
if (res.data.type === 'register') {
@@ -254,9 +308,9 @@
this.getUserInfo(res.data);
}
}).catch(res => {
that.$util.Tips({
title: res
});
this.$util.Tips({
title: res
});
});
},
again() {
@@ -267,16 +321,8 @@
this.keyCode +
Date.parse(new Date());
},
getCode() {
let that = this
},
async getLogoImage() {
let that = this;
getLogo().then(res => {
that.logoUrl = res.data.logoUrl?res.data.logoUrl:'/static/images/logo2.png';
});
},
async loginMobile() {
//手机号验证码登录
loginMobile:Debounce(function() {
let that = this;
if (!that.account) return that.$util.Tips({
title: '请填写手机号码'
@@ -290,10 +336,14 @@
if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
title: '请输入正确的验证码'
});
uni.showLoading({
title: '登录中'
})
loginMobile({
phone: that.account,
captcha: that.captcha,
spread_spid: that.$Cache.get("spread")
// spread_spid: uni.getStorageSync('spid')
})
.then(res => {
let data = res.data;
@@ -301,14 +351,16 @@
this.$store.commit("LOGIN", {
'token': res.data.token
});
uni.hideLoading();
that.getUserInfo(data);
})
.catch(res => {
uni.hideLoading();
that.$util.Tips({
title: res
});
});
},
}),
async register() {
let that = this;
if (!that.account) return that.$util.Tips({
@@ -333,7 +385,8 @@
account: that.account,
captcha: that.captcha,
password: that.password,
spread: that.$Cache.get("spread")
spread_spid: that.$Cache.get("spread")
// spread_spid: uni.getStorageSync('spid') || 0
})
.then(res => {
that.$util.Tips({
@@ -356,21 +409,13 @@
title: '请输入正确的手机号码'
});
if (that.formItem == 2) that.type = "register";
await registerVerify(that.account)
.then(res => {
that.$util.Tips({title:res.message});
that.sendCode();
})
.catch(err => {
return that.$util.Tips({
title: err
});
});
that.$refs.verify.show();
},
navTap: function(index) {
this.current = index;
},
async submit() {
//账号密码登录
submit:Debounce(function() {
let that = this;
if (!that.account) return that.$util.Tips({
title: '请填写账号'
@@ -381,48 +426,40 @@
if (!that.password) return that.$util.Tips({
title: '请填写密码'
});
uni.showLoading({
title: '登录中'
})
loginH5({
account: that.account,
password: that.password,
spread: that.$Cache.get("spread")
})
.then(({
data
}) => {
spread_spid: that.$Cache.get("spread")
}).then(({data}) => {
this.$store.commit("LOGIN", {
'token': data.token
});
uni.hideLoading();
that.getUserInfo(data);
})
.catch(e => {
uni.hideLoading();
that.$util.Tips({
title: e
});
});
},
}),
getUserInfo(data){
this.$store.commit("SETUID", data.uid);
this.$store.commit("SETUID", data.uid);
getUserInfo().then(res => {
this.$store.commit("UPDATE_USERINFO", res.data);
let backUrl = this.$Cache.get(BACK_URL) || "/pages/index/index";
if (backUrl.indexOf('/pages/users/login/index') !== -1) {
if (backUrl.indexOf('/pages/users/login/index') !== -1) {
backUrl = '/pages/index/index';
}
// #ifdef APP
uni.reLaunch({
url: "/pages/index/index"
});
return
// #endif
console.log(69999);
console.log(backUrl);
uni.reLaunch({
url: backUrl
});
})
}
},
}
};
</script>
@@ -502,6 +539,12 @@
}
}
.main_color{
@include main_color(theme);
}
.bg_color{
@include main_bg_color(theme);
}
.code img {
width: 100%;
height: 100%;
@@ -605,4 +648,13 @@
}
}
}
.protocol {
margin: 30rpx 0;
padding-left: 44rpx;
.protocol_text {
.font_pro {
@include main_color(theme);
}
}
}
</style>

View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
<template>
<view>
<view :data-theme="theme">
<view class='my-order'>
<view class='header bg-color'>
<view class='picTxt acea-row row-between-wrapper'>
@@ -40,18 +40,9 @@
<view class='title acea-row row-between-wrapper'>
<view class="acea-row row-middle">
<text class="sign cart-color acea-row row-center-wrapper" v-if="item.activityType !== '普通' && item.activityType !== '核销'">{{item.activityType}}</text>
<!-- <text class="sign cart-color acea-row row-center-wrapper" v-if="item.bargainId != 0">砍价</text>
<text class="sign cart-color acea-row row-center-wrapper" v-else-if="item.storeOrder.combinationId != 0">拼团</text>
<text class="sign cart-color acea-row row-center-wrapper" v-else-if="item.storeOrder.seckillId != 0">秒杀</text> -->
<view>{{item.createTime}}</view>
</view>
<view class='font-color'>{{item.orderStatus}}</view>
<!-- <view v-if="item.status?item.status.type == 0:0" class='font-color'>待付款</view>
<view v-else-if="item.status?item.status.type == 1:0 && item.storeOrder.shippingType==1" class='font-color'>待发货</view>
<view v-else-if="item.status?item.status.type == 2:0 && item.storeOrder.shippingType==1" class='font-color'>待收货</view>
<view v-else-if="item.status?item.status.type == 3:0 && item.storeOrder.shippingType==1" class='font-color'>待评价</view>
<view v-else-if="item.status?item.status.type == 4:0 && item.storeOrder.shippingType==1" class='font-color'>已完成</view>
<view v-else-if="item.storeOrder.shippingType==2" class='font-color'>待核销</view> -->
</view>
<view class='item-info acea-row row-between row-top' v-for="(items,index) in item.orderInfoList" :key="index">
<view class='pictrue'>
@@ -76,16 +67,6 @@
<view class='bnt bg-color' v-else-if="item.status==2" @click='goOrderDetails(item.orderId)'>去评价</view>
<view class='bnt cancelBnt' v-if="item.status == 3" @click='delOrder(item.id,index)'>删除订单</view>
</view>
<!-- <view class='bottom acea-row row-right row-middle'>
<view class='bnt cancelBnt' v-if="item.status?item.status.type==0:0 || item.status?item.status.type == 9:0" @click='cancelOrder(index,item.id)'>取消订单</view>
<view class='bnt bg-color' v-if="item.status?item.status.type == 0:0" @click='goPay(item.payPrice,item.orderId)'>立即付款</view>
<view class='bnt bg-color' v-else-if="item.status?item.status.type == 1:0 || item.status?item.status.type == 9:0" @click='goOrderDetails(item.orderId)'>查看详情</view>
<view class='bnt bg-color' v-else-if="item.status?item.status.type == 2:0 && item.status.deliveryType" @click='goOrderDetails(item.orderId)'>查看详情</view>
<view class='bnt bg-color' v-else-if="item.status?item.status.type == 3:0" @click='goOrderDetails(item.orderId)'>去评价</view>
<view class='bnt bg-color' v-else-if="item.storeOrder.seckillId < 1 && item.storeOrder.bargainId < 1 && item.storeOrder.combinationId < 1 && item.status?item.status.type == 4:0"
@click='goOrderDetails(item.orderId)'>再次购买</view>
<view class='bnt cancelBnt' v-if="item.status?item.status.type == 4:0" @click='delOrder(item.id,index)'>删除订单</view>
</view> -->
</view>
</view>
<view class='loadingicon acea-row row-center-wrapper' v-if="orderList.length>0">
@@ -126,18 +107,13 @@
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import emptyPage from '@/components/emptyPage.vue'
let app = getApp();
export default {
components: {
payment,
home,
emptyPage,
// #ifdef MP
authorize
// #endif
},
data() {
return {
@@ -162,12 +138,13 @@
title: '可用余额:',
number: 0
}
],
],
pay_close: false,
pay_order_id: '',
totalPrice: '0',
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
isShowAuth: false ,//是否隐藏授权
theme:app.globalData.theme,
};
},
computed: mapGetters(['isLogin', 'userInfo']),
@@ -297,7 +274,7 @@
openOrderSubscribe().then(() => {
uni.hideLoading();
uni.navigateTo({
url: '/pages/order_details/index?order_id=' + order_id
url: '/pages/order/order_details/index?order_id=' + order_id
})
}).catch(() => {
uni.hideLoading();
@@ -305,7 +282,7 @@
// #endif
// #ifndef MP
uni.navigateTo({
url: '/pages/order_details/index?order_id=' + order_id
url: '/pages/order/order_details/index?order_id=' + order_id
})
// #endif
},
@@ -458,9 +435,11 @@
.my-order .list .item .title .sign {
font-size: 24rpx;
padding: 0 13rpx;
height: 36rpx;
height: 40rpx;
margin-right: 15rpx;
border-radius: 18rpx;
@include coupons_border_color(theme);
@include main_color(theme);
}
.my-order .list .item .item-info {
@@ -547,4 +526,7 @@
width: 100%;
height: 100%;
}
// .bg-color {
// @include main_bg_color(theme);
// }
</style>

View File

@@ -1,43 +0,0 @@
<template>
<view class="content">
<jyf-parser :html="content" ref="article" :tag-style="tagStyle"></jyf-parser>
</view>
</template>
<script>
import parser from "@/components/jyf-parser/jyf-parser";
import {
getUserAgreement,
} from '@/api/user.js';
export default {
components: {
"jyf-parser": parser
},
data() {
return {
tagStyle: {
img: 'width:100%;display:block;',
table: 'width:100%',
video: 'width:100%'
},
content: ``
}
},
mounted() {
getUserAgreement().then(res => {
this.content = res.data.content
}).catch(err => {
that.$util.Tips({
title: err.msg
});
})
}
}
</script>
<style scoped>
.content {
padding: 40rpx 30rpx;
line-height: 2;
}
</style>

View File

@@ -1,367 +0,0 @@
<template>
<view>
<view class="promoter-list">
<view class='promoterHeader bg-color'>
<view class='headerCon acea-row row-between'>
<view>
<view class='name'>推广人数</view>
<view><text class='num'>{{peopleData.count}}</text></view>
</view>
<view class='iconfont icon-tuandui'></view>
</view>
</view>
<view class="pad30">
<view class='nav acea-row row-around'>
<view :class="grade == 0 ? 'item on' : 'item'" @click='setType(0)'>一级({{peopleData.total}})</view>
<view :class="grade == 1 ? 'item on' : 'item'" @click='setType(1)'>二级({{peopleData.totalLevel}})
</view>
</view>
<view class='search acea-row row-between-wrapper'>
<view class='input'><input placeholder='点击搜索会员名称' placeholder-class='placeholder' v-model="keyword"
@confirm="submitForm" confirm-type='search' name="search"></input></view>
<button class='iconfont icon-sousuo2' @click="submitForm"></button>
</view>
<view class='list'>
<view class="sortNav acea-row row-middle">
<view class="sortItem" @click='setSort("childCount","ASC")' v-if="sort == 'childCountDESC'">团队排序
<image src='/static/images/sort1.png'></image>
</view>
<view class="sortItem" @click='setSort("childCount")' v-else-if="sort == 'childCountASC'">团队排序
<image src='/static/images/sort3.png'></image>
</view>
<view class="sortItem" @click='setSort("childCount","DESC")' v-else>团队排序
<image src='/static/images/sort2.png'></image>
</view>
<view class="sortItem" @click='setSort("numberCount","ASC")' v-if="sort == 'numberCountDESC'">
金额排序
<image src='/static/images/sort1.png'></image>
</view>
<view class="sortItem" @click='setSort("numberCount")' v-else-if="sort == 'numberCountASC'">金额排序
<image src='/static/images/sort3.png'></image>
</view>
<view class="sortItem" @click='setSort("numberCount","DESC")' v-else>金额排序
<image src='/static/images/sort2.png'></image>
</view>
<view class="sortItem" @click='setSort("orderCount","ASC")' v-if="sort == 'orderCountDESC'">订单排序
<image src='/static/images/sort1.png'></image>
</view>
<view class="sortItem" @click='setSort("orderCount")' v-else-if="sort == 'orderCountASC'">订单排序
<image src='/static/images/sort3.png'></image>
</view>
<view class="sortItem" @click='setSort("orderCount","DESC")' v-else>订单排序
<image src='/static/images/sort2.png'></image>
</view>
</view>
<block v-for="(item,index) in recordList" :key="index">
<view class='item acea-row row-between-wrapper'>
<view class="picTxt acea-row row-between-wrapper">
<view class='pictrue'>
<image :src='item.avatar'></image>
</view>
<view class='text'>
<view class='name line1'>{{item.nickname}}</view>
<view>加入时间: {{item.time.split(' ')[0]}}</view>
</view>
</view>
<view class="right">
<view><text class='num font-color'>{{item.childCount ? item.childCount : 0}}</text>
</view>
<view><text class="num">{{item.orderCount ? item.orderCount : 0}}</text></view>
<view><text class="num">{{item.numberCount ? item.numberCount : 0}}</text></view>
</view>
</view>
</block>
<Loading :loaded="status" :loading="loadingList"></Loading>
<block v-if="recordList.length == 0 && isShow">
<emptyPage title="暂无推广人数~"></emptyPage>
</block>
</view>
</view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
<script>
import {
spreadPeople,
spreadPeoCount
} from '@/api/user.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
import emptyPage from '@/components/emptyPage.vue'
import Loading from "@/components/Loading";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import home from '@/components/home';
export default {
components: {
Loading,
emptyPage,
// #ifdef MP
authorize,
// #endif
home
},
data() {
return {
page: 1,
limit: 20,
keyword: '',
sort: '',
isAsc: '',
sortKey: '',
grade: 0,
status: false,
loadingList: false,
recordList: [],
peopleData: {},
isShow: false,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
};
},
computed: mapGetters(['isLogin']),
onLoad() {
if (this.isLogin) {
this.userSpreadNewList();
this.spreadPeoCount();
} else {
toLogin();
}
},
onShow: function() {
if (this.is_show) this.userSpreadNewList();
},
onHide: function() {
this.is_show = true;
},
methods: {
onLoadFun: function(e) {
this.userSpreadNewList();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
setSort: function(sortKey, isAsc) {
let that = this;
that.isAsc = isAsc;
that.sort = sortKey + isAsc;
that.sortKey = sortKey;
that.page = 1;
that.limit = 20;
that.status = false;
that.$set(that, 'recordList', []);
that.userSpreadNewList();
},
submitForm: function() {
this.page = 1;
this.limit = 20;
this.status = false;
this.$set(this, 'recordList', []);
this.userSpreadNewList();
},
setType: function(grade) {
if (this.grade != grade) {
this.grade = grade;
this.page = 1;
this.limit = 20;
this.keyword = '';
this.sort = '';
this.isAsc = '';
this.status = false;
this.loadingList = false;
this.$set(this, 'recordList', []);
this.userSpreadNewList();
}
},
spreadPeoCount() {
spreadPeoCount().then(res => {
this.peopleData = res.data;
});
},
userSpreadNewList: function() {
let that = this;
let page = that.page;
let limit = that.limit;
let status = that.status;
let keyword = that.keyword;
let isAsc = that.isAsc;
let sortKey = that.sortKey;
let grade = that.grade;
let recordList = that.recordList;
let recordListNew = [];
if (that.loadingList) return;
if (status == true) return;
spreadPeople({
page: page,
limit: limit,
keyword: keyword,
grade: grade,
sortKey: sortKey,
isAsc: isAsc
}).then(res => {
let recordListData = res.data.list ? res.data.list : [];
let len = recordListData.length;
recordListNew = recordList.concat(recordListData);
that.status = limit > len;
that.page = page + 1;
that.$set(that, 'recordList', recordListNew || []);
that.loadingList = false;
if(that.recordList.length===0) that.isShow = true;
});
}
},
onReachBottom: function() {
this.userSpreadNewList();
}
}
</script>
<style scoped lang="scss">
.promoter-list .nav {
background-color: #fff;
height: 86rpx;
line-height: 86rpx;
font-size: 28rpx;
color: #282828;
border-bottom: 1rpx solid #eee;
border-top-left-radius: 14rpx;
border-top-right-radius: 14rpx;
margin-top: -30rpx;
}
.promoter-list .nav .item.on {
border-bottom: 5rpx solid $theme-color;
color: $theme-color;
}
.promoter-list .search {
width: 100%;
background-color: #fff;
height: 100rpx;
padding: 0 24rpx;
box-sizing: border-box;
border-bottom-left-radius: 14rpx;
border-bottom-right-radius: 14rpx;
}
.promoter-list .search .input {
width: 592rpx;
height: 60rpx;
border-radius: 50rpx;
background-color: #f5f5f5;
text-align: center;
position: relative;
}
.promoter-list .search .input input {
height: 100%;
font-size: 26rpx;
width: 610rpx;
text-align: center;
}
.promoter-list .search .input .placeholder {
color: #bbb;
}
.promoter-list .search .input .iconfont {
position: absolute;
right: 28rpx;
color: #999;
font-size: 28rpx;
top: 50%;
transform: translateY(-50%);
}
.promoter-list .search .iconfont {
font-size: 32rpx;
color: #515151;
height: 60rpx;
line-height: 60rpx;
}
.promoter-list .list {
margin-top: 20rpx;
}
.promoter-list .list .sortNav {
background-color: #fff;
height: 76rpx;
border-bottom: 1rpx solid #eee;
color: #333;
font-size: 28rpx;
border-top-left-radius: 14rpx;
border-top-right-radius: 14rpx;
}
.promoter-list .list .sortNav .sortItem {
text-align: center;
flex: 1;
}
.promoter-list .list .sortNav .sortItem image {
width: 24rpx;
height: 24rpx;
margin-left: 6rpx;
vertical-align: -3rpx;
}
.promoter-list .list .item {
background-color: #fff;
border-bottom: 1rpx solid #eee;
height: 152rpx;
padding: 0 24rpx;
font-size: 24rpx;
color: #666;
}
.promoter-list .list .item .picTxt .pictrue {
width: 106rpx;
height: 106rpx;
border-radius: 50%;
}
.promoter-list .list .item .picTxt .pictrue image {
width: 100%;
height: 100%;
border-radius: 50%;
border: 3rpx solid #fff;
box-shadow: 0 0 10rpx #aaa;
box-sizing: border-box;
}
.promoter-list .list .item .picTxt .text {
// width: 304rpx;
font-size: 24rpx;
color: #666;
margin-left: 14rpx;
}
.promoter-list .list .item .picTxt .text .name {
font-size: 28rpx;
color: #333;
margin-bottom: 13rpx;
}
.promoter-list .list .item .right {
text-align: right;
font-size: 22rpx;
color: #333;
}
.promoter-list .list .item .right .num {
margin-right: 7rpx;
}
</style>

View File

@@ -1,219 +0,0 @@
<template>
<view>
<view class="promoter-order">
<view class='promoterHeader bg-color'>
<view class='headerCon acea-row row-between-wrapper'>
<view>
<view class='name'>累积推广订单</view>
<view><text class='num'>{{recordCount || 0}}</text></view>
</view>
<view class='iconfont icon-2'></view>
</view>
</view>
<view class='list pad30' v-if="recordList.length>0">
<block v-for="(item,index) in recordList" :key="index">
<view class='item'>
<view class='title acea-row row-column row-center'>
<view class='data'>{{item.time}}</view>
<view>本月累计推广订单{{item.count || 0}}</view>
</view>
<view class='listn'>
<block v-for="(child,indexn) in item.child" :key="indexn">
<view class='itenm borRadius14'>
<view class='top acea-row row-between-wrapper'>
<view class='pictxt acea-row row-between-wrapper'>
<view class='pictrue'>
<image :src='child.avatar'></image>
</view>
<view class='text line1'>{{child.nickname}}</view>
</view>
<view class='money'>返佣<text class='font-color'>{{child.number}}</text></view>
<!-- <view class='money' v-if="child.type == 'brokerage'">返佣<text class='font-color'>{{child.number}}</text></view>
<view class='money' v-else>暂未返佣<text class='font-color'>{{child.number}}</text></view> -->
</view>
<view class='bottom'>
<view><text class='name'>订单编号</text>{{child.orderId}}</view>
<view><text class='name'>下单时间</text>{{child.time}}</view>
</view>
</view>
</block>
</view>
</view>
</block>
</view>
<view v-if="recordList.length == 0">
<emptyPage title="暂无推广订单~"></emptyPage>
</view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
<script>
import {
spreadOrder
} from '@/api/user.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import emptyPage from '@/components/emptyPage.vue'
import home from '@/components/home';
export default {
components: {
// #ifdef MP
authorize,
// #endif
emptyPage,
home
},
data() {
return {
page: 1,
limit: 10,
status: false,
recordList: [],
recordCount: 0,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false,//是否隐藏授权
time: 0
};
},
computed: mapGetters(['isLogin']),
onLoad() {
if (this.isLogin) {
this.getRecordOrderList();
} else {
toLogin();
}
},
methods: {
stringToDate : function(data){
let str = data.replace(/-/g,'/');
let date = new Date(str);
return data;
},
onLoadFun() {
this.getRecordOrderList();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
getRecordOrderList: function() {
let that = this;
let page = that.page;
let limit = that.limit;
let status = that.status;
let recordList = that.recordList;
let newList = [];
if (status == true) return;
spreadOrder({
page: page,
limit: limit
}).then(res => {
let recordListData = res.data.list ? res.data.list : [];
// 每页返回的总条数;
let len = 0;
for(let i = 0;i<recordListData.length;i++) {
len = len + recordListData[i].child.length;
let str = recordListData[i].time.replace(/-/g,'/');
let date = new Date(str).getTime();
if(that.time === date){
that.$set(that.recordList[i],'child',that.recordList[i].child.concat(recordListData[i].child));
}else{
recordListData.forEach((item,index)=>{
if(recordListData[i]==item){
newList.push(item);
}
})
that.$set(that, 'recordList', recordList.concat(newList));
}
that.time = date;
};
that.recordCount = res.data.count || 0;
that.status = limit > len;
that.page = page + 1;
});
}
},
onReachBottom() {
this.getRecordOrderList()
}
}
</script>
<style scoped lang="scss">
.promoter-order .list .item .title {
height: 133rpx;
font-size: 26rpx;
color: #999;
}
.promoter-order .list .item .title .data {
font-size: 28rpx;
color: #282828;
margin-bottom: 5rpx;
}
.promoter-order .list .item .listn .itenm {
background-color: #fff;
}
.promoter-order .list .item .listn .itenm~.itenm {
margin-top: 20rpx;
}
.promoter-order .list .item .listn .itenm .top {
padding: 0 24rpx;
border-bottom: 1rpx solid #eee;
height: 100rpx;
}
.promoter-order .list .item .listn .itenm .top .pictxt {
width: 320rpx;
}
.promoter-order .list .item .listn .itenm .top .pictxt .text {
width: 230rpx;
font-size: 30rpx;
color: #282828;
}
.promoter-order .list .item .listn .itenm .top .pictxt .pictrue {
width: 66rpx;
height: 66rpx;
}
.promoter-order .list .item .listn .itenm .top .pictxt .pictrue image {
width: 100%;
height: 100%;
border-radius: 50%;
border: 3rpx solid #fff;
box-sizing: border-box;
box-shadow: 0 0 15rpx #aaa;
}
.promoter-order .list .item .listn .itenm .top .money {
font-size: 28rpx;
}
.promoter-order .list .item .listn .itenm .bottom {
padding: 20rpx 24rpx;
font-size: 28rpx;
color: #666;
line-height: 1.6;
}
.promoter-order .list .item .listn .itenm .bottom .name {
color: #999;
}
</style>

View File

File diff suppressed because one or more lines are too long

View File

@@ -1,161 +0,0 @@
<template>
<div class="register absolute">
<div class="shading">
<div class="pictrue acea-row row-center-wrapper">
<image src="../../../static/images/logo2.png" />
</div>
</div>
<div class="whiteBg">
<div class="title">找回密码</div>
<div class="list">
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/phone_1.png"></image>
<input type="text" placeholder="输入手机号码" v-model="account" />
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png"></image>
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
{{ text }}
</button>
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png"></image>
<input type="password" placeholder="填写您的新密码" v-model="password" />
</div>
</div>
<div class="item" v-if="isShowCode">
<div class="align-left">
<input type="text" placeholder="填写验证码" class="codeIput" v-model="codeVal" />
<div class="code" @click="again"><img :src="codeUrl" /></div>
</div>
</div>
</div>
<div class="logon" @click="registerReset">确认</div>
<div class="tip">
<span class="font-color-red" @click="back">立即登录</span>
</div>
</div>
<div class="bottom"></div>
</div>
</template>
<script>
import sendVerifyCode from "@/mixins/SendVerifyCode";
import {
registerVerify,
registerReset,
getCodeApi
} from "@/api/user";
// import { validatorDefaultCatch } from "@/utils/dialog";
// import attrs, { required, alpha_num, chs_phone } from "@utils/validate";
// import { VUE_APP_API_URL } from "@utils";
export default {
name: "RetrievePassword",
data: function() {
return {
account: "",
password: "",
captcha: "",
keyCode: "",
codeUrl: "",
codeVal: "",
isShowCode: false
};
},
mixins: [sendVerifyCode],
mounted: function() {
this.getCode();
},
methods: {
back() {
uni.navigateBack();
},
again() {
this.codeUrl =
VUE_APP_API_URL + "/captcha?" + this.keyCode + Date.parse(new Date());
},
getCode() {
getCodeApi()
.then(res => {
this.keyCode = res.data.key;
})
.catch(res => {
this.$dialog.error(res.msg);
});
},
async registerReset() {
var that = this;
if (!that.account) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (!that.captcha) return that.$util.Tips({
title: '请填写验证码'
});
registerReset({
account: that.account,
captcha: that.captcha,
password: that.password,
code: that.codeVal
})
.then(res => {
that.$util.Tips({
title: res.message
}, {
tab: 3
})
})
.catch(res => {
that.$util.Tips({
title: res
})
});
},
async code() {
let that = this;
if (!that.account) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (that.formItem == 2) that.type = "register";
await registerVerify({
phone: that.account,
type: that.type,
key: that.keyCode,
code: that.codeVal
})
.then(res => {
that.$dialog.success(res.message);
that.sendCode();
})
.catch(res => {
// if (res.data.status === 402) {
// that.codeUrl = `${VUE_APP_API_URL}/sms_captcha?key=${that.keyCode}`;
// that.isShowCode = true;
// }
that.$util.Tips({
title: res
});
});
},
}
};
</script>
<style scoped>
.code img {
width: 100%;
height: 100%;
}
</style>

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 725 B

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -1,20 +1,17 @@
<template>
<view>
<!-- #ifdef APP-->
<view class='status'></view>
<!-- #endif -->
<view :data-theme="theme">
<form @submit="formSubmit" report-submit='true'>
<view class='addAddress pad30'>
<view class='list borRadius14'>
<view class='item acea-row row-between-wrapper' style="border: none;">
<view class='name'>姓名</view>
<input type='text' placeholder='请输入姓名' placeholder-style="color:#ccc;" name='realName' :value="userAddress.realName"
placeholder-class='placeholder' maxlength="4"></input>
<input type='text' placeholder='请输入姓名' placeholder-style="color:#ccc;" name='realName'
:value="userAddress.realName" placeholder-class='placeholder' maxlength="20"></input>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='name'>联系电话</view>
<input type='number' placeholder='请输入联系电话' placeholder-style="color:#ccc;" name="phone" :value='userAddress.phone'
placeholder-class='placeholder' maxlength="11"></input>
<input type='number' placeholder='请输入联系电话' placeholder-style="color:#ccc;" name="phone"
:value='userAddress.phone' placeholder-class='placeholder' maxlength="11"></input>
</view>
<view class='item acea-row row-between-wrapper relative'>
<view class='name'>所在地区</view>
@@ -30,9 +27,9 @@
</view>
<view class='item acea-row row-between-wrapper relative'>
<view class='name'>详细地址</view>
<input type='text' placeholder='请填写具体地址' placeholder-style="color:#ccc;" name='detail' placeholder-class='placeholder'
v-model='userAddress.detail' maxlength="18"></input>
<view class='iconfont icon-dizhi font-color abs_right' @tap="chooseLocation"></view>
<input type='text' placeholder='请填写具体地址' placeholder-style="color:#ccc;" name='detail'
placeholder-class='placeholder' v-model='userAddress.detail' maxlength="100"></input>
<view class='iconfont icon-dizhi font_color abs_right' @tap="chooseLocation"></view>
</view>
</view>
<view class='default acea-row row-middle borRadius14'>
@@ -41,7 +38,7 @@
</checkbox-group>
</view>
<button class='keepBnt bg-color' form-type="submit">立即保存</button>
<button class='keepBnt bg_color' form-type="submit">立即保存</button>
<!-- #ifdef MP -->
<view class="wechatAddress" v-if="!id" @click="getWxAddress">导入微信地址</view>
<!-- #endif -->
@@ -50,10 +47,7 @@
<!-- #endif -->
</view>
</form>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<!-- <home></home> -->
<view v-show="showLoading" class="bg-fixed"></view>
</view>
</template>
@@ -62,6 +56,9 @@
editAddress,
getAddressDetail
} from '@/api/user.js';
import {
getCityList
} from "@/utils";
import {
getCity
} from '@/api/api.js';
@@ -71,22 +68,17 @@
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import home from '@/components/home';
// import city from '@/utils/cityData';
import {
Debounce
} from '@/utils/validate.js'
import atModel from '@/components/accredit/index.vue';
let app = getApp();
export default {
components: {
// #ifdef MP
authorize,
// #endif
home
atModel
},
data() {
return {
regionDval: ['浙江省', '杭州市', '滨江区'],
cartId: '', //购物车id
pinkId: 0, //拼团id
couponId: 0, //优惠券id
@@ -96,17 +88,15 @@
}, //地址详情
region: ['省', '市', '区'],
valueRegion: [0, 0, 0],
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
district: [],
multiArray: [],
multiIndex: [0, 0, 0],
cityId: 0,
defaultRegion: ['广东省', '广州市', '番禺区'],
defaultRegionCode: '440113',
bargain: false, //是否是砍价
combination: false, //是否是拼团
secKill: false, //是否是秒杀
theme: app.globalData.theme,
showLoading: false
};
},
computed: mapGetters(['isLogin']),
@@ -115,13 +105,28 @@
handler: function(newV, oldV) {
if (newV) {
this.getUserAddress();
this.getCityList();
}
},
deep: true
}
},
onLoad(options) {
if (this.$Cache.getItem('cityList')) {
//检测城市数据缓存是否过期,有的话从缓存取,没有的话请求接口
this.district = this.$Cache.getItem('cityList');
this.initialize();
} else {
this.showLoading = true;
uni.showLoading({
title: '数据加载中...'
});
getCityList().then(res=>{
this.district = res
this.initialize();
uni.hideLoading();
this.showLoading = false;
})
}
if (this.isLogin) {
this.preOrderNo = options.preOrderNo || 0;
this.id = options.id || 0;
@@ -129,13 +134,6 @@
title: options.id ? '修改地址' : '添加地址'
})
this.getUserAddress();
if(this.$Cache.has('cityList')){
//检测城市数据是否存在缓存,有的话从缓存取,没有的话请求接口
this.district = this.$Cache.getItem('cityList')
this.initialize();
}else{
this.getCityList();
}
} else {
toLogin();
}
@@ -147,31 +145,44 @@
this.region = region
},
// #endif
// 获取地址数据
getCityList: function() {
getUserAddress: function() {
if (!this.id) return false;
let that = this;
getCity().then(res => {
this.district = res.data;
let oneDay = 24 * 3600 * 1000;
// this.$Cache.set('cityList', JSON.stringify(res.data)); //设置不过期时间的方法
this.$Cache.setItem({name:'cityList',value:res.data,expires:oneDay * 7}); //设置七天过期时间
that.initialize();
})
getAddressDetail(this.id).then(res => {
if(res.data){
let region = [res.data.province, res.data.city, res.data.district];
that.$set(that, 'userAddress', res.data);
that.$set(that, 'region', region);
that.city_id = res.data.cityId;
}
});
},
initialize: function() {
let that = this,province = [],city = [],area = [];
if (that.district.length) {
let cityChildren = that.district[0].child || [];
let areaChildren = cityChildren.length ? (cityChildren[0].child || []) : [];
that.district.forEach(function(item) {
that.district.forEach(function(item,i) {
province.push(item.name);
if (item.name === that.region[0]) {
that.valueRegion[0] = i
that.multiIndex[0] = i
}
});
cityChildren.forEach(function(item) {
that.district[this.valueRegion[0]].child.forEach((item,i)=>{
city.push(item.name);
});
areaChildren.forEach(function(item) {
if (that.region[1] == item.name) {
that.valueRegion[1] = i
that.multiIndex[1] = i
}
})
that.district[this.valueRegion[0]].child[this.valueRegion[1]].child.forEach((item,i)=>{
area.push(item.name);
});
if (that.region[2] == item.name) {
that.valueRegion[2] = i
that.multiIndex[2] = i
}
})
this.multiArray = [province, city, area]
}
},
@@ -181,13 +192,15 @@
child: []
},
city = province.child[multiIndex[1]] || {
child: []
},
area = city.child[multiIndex[2]] || {
cityId: 0
},
multiArray = this.multiArray,
value = e.detail.value;
this.region = [multiArray[0][value[0]], multiArray[1][value[1]], multiArray[2][value[2]]]
this.cityId = city.cityId
this.cityId = area.cityId;
this.valueRegion = [0, 0, 0]
this.initialize();
},
@@ -234,35 +247,22 @@
this.multiIndex = multiIndex
// this.setData({ multiArray: multiArray, multiIndex: multiIndex});
},
// 授权回调
onLoadFun: function() {
this.getUserAddress();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
toggleTab(str) {
this.$refs[str].show();
},
onConfirm(val) {
this.region = val.checkArr[0] + '-' + val.checkArr[1] + '-' + val.checkArr[2];
},
getUserAddress: function() {
if (!this.id) return false;
let that = this;
getAddressDetail(this.id).then(res => {
let region = [res.data.province, res.data.city, res.data.district];
that.$set(that, 'userAddress', res.data);
that.$set(that, 'region', region);
that.city_id = res.data.cityId
});
},
chooseLocation: function () {
uni.chooseLocation({
success: (res) => {
this.$set(this.userAddress,'detail',res.address.replace(/.+?(省|市|自治区|自治州|县|区)/g,''));
}
//选择地位地址
chooseLocation: function() {
this.$util.$L.getLocation().then(res=>{
uni.chooseLocation({
latitude: uni.getStorageSync('user_latitude'),
longitude: uni.getStorageSync('user_longitude'),
success: (res) => {
this.$set(this.userAddress, 'detail', res.name);
}
})
})
},
// 导入共享地址(小程序)
@@ -296,7 +296,7 @@
that.pinkId = '';
that.couponId = '';
uni.navigateTo({
url: '/pages/users/order_confirm/index?cartId=' +
url: '/pages/order/order_confirm/index?cartId=' +
cartId +
'&addressId=' + (
that.id ? that
@@ -386,7 +386,7 @@
that.pinkId = '';
that.couponId = '';
uni.navigateTo({
url: '/pages/users/order_confirm/index?cartId=' +
url: '/pages/order/order_confirm/index?cartId=' +
cartId + '&addressId=' + (that.id ? that.id :
res.data
.id) + '&pinkId=' + pinkId + '&couponId=' +
@@ -421,7 +421,7 @@
* 提交用户添加地址
*
*/
formSubmit: function(e) {
formSubmit: Debounce(function(e) {
let that = this,
value = e.detail.value;
if (!value.realName) return that.$util.Tips({
@@ -465,9 +465,11 @@
icon: 'success'
});
setTimeout(function() {
if (that.preOrderNo>0) {
if (that.preOrderNo > 0) {
uni.redirectTo({
url: '/pages/users/order_confirm/index?preOrderNo=' + that.preOrderNo + '&addressId=' + (that.id ? that.id : res.data.id)
url: '/pages/order/order_confirm/index?preOrderNo=' + that
.preOrderNo + '&addressId=' + (that.id ? that.id : res
.data.id)
})
} else {
// #ifdef H5
@@ -485,7 +487,7 @@
title: err
});
})
},
}),
ChangeIsDefault: function(e) {
this.$set(this.userAddress, 'isDefault', !this.userAddress.isDefault);
}
@@ -494,9 +496,20 @@
</script>
<style scoped lang="scss">
.bg-fixed{
width: 100%;
height: 750rpx;
position: absolute;
top: 0;
}
.addAddress {
padding-top: 20rpx;
}
.bg_color {
@include main_bg_color(theme);
}
.addAddress .list {
background-color: #fff;
padding: 0 24rpx;
@@ -564,26 +577,39 @@
line-height: 86rpx;
margin: 0 auto;
font-size: 32rpx;
color: #E93323 ;
border: 1px solid #E93323;
// color: #E93323 ;
@include main_color(theme);
@include coupons_border_color(theme);
}
.relative{
.font_color {
@include main_color(theme);
}
.relative {
position: relative;
}
.icon-dizhi{
.icon-dizhi {
font-size: 44rpx;
z-index: 100;
}
.abs_right{
.abs_right {
position: absolute;
right:0;
right: 0;
}
.status{
display: flex;
width: 750rpx;
// background-color: #E93323;
height: var(--status-bar-height);
/deep/ checkbox .uni-checkbox-input.uni-checkbox-input-checked {
@include main_bg_color(theme);
@include coupons_border_color(theme);
color: #fff !important
}
/deep/ checkbox .wx-checkbox-input.wx-checkbox-input-checked {
@include main_bg_color(theme);
@include coupons_border_color(theme);
color: #fff !important;
margin-right: 0 !important;
}
</style>

View File

@@ -1,15 +1,12 @@
<template>
<view>
<!-- #ifdef APP-->
<view class='status_1'></view>
<!-- #endif -->
<view :data-theme="theme">
<view class='line'>
<image src='../../../static/images/line.jpg' v-if="addressList.length"></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/line.jpg'" v-if="addressList.length"></image>
</view>
<view class='address-management' :class='addressList.length < 1 && page > 1 ? "fff":""'>
<radio-group class="radio-group" @change="radioChange" v-if="addressList.length">
<view class='item borRadius14' v-for="(item,index) in addressList" :key="index">
<view class='address' @click='goOrder(item.id)'>
<view class='address' @click='goOrder(item)'>
<view class='consignee'>收货人{{item.realName}}<text class='phone'>{{item.phone}}</text></view>
<view>收货地址{{item.province}}{{item.city}}{{item.district}}{{item.detail}}</view>
</view>
@@ -36,32 +33,33 @@
</view>
<view class='noCommodity' v-if="addressList.length < 1 && page > 1">
<view class='pictrue'>
<image src='../../../static/images/noAddress.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/noAddress.png'"></image>
</view>
</view>
<view style='height:120rpx;'></view>
</view>
<view class='footer acea-row row-between-wrapper'>
<!-- #ifdef APP-PLUS -->
<view class='addressBnt bg_color on' @click='addAddress'><text
class='iconfont icon-tianjiadizhi'></text>添加新地址</view>
<!-- #endif -->
<!-- #ifdef MP-->
<view class='addressBnt bg-color' @click='addAddress'><text class='iconfont icon-tianjiadizhi'></text>添加新地址</view>
<view class='addressBnt wxbnt' @click='getWxAddress'><text class='iconfont icon-weixin2'></text>导入微信地址</view>
<view class='addressBnt bg_color' @click='addAddress'><text class='iconfont icon-tianjiadizhi'></text>添加新地址
</view>
<view class='addressBnt wxbnt' @click='getWxAddress'><text class='iconfont icon-weixin2'></text>导入微信地址
</view>
<!-- #endif -->
<!-- #ifdef H5-->
<view class='addressBnt bg-color' :class="this.$wechat.isWeixin()?'':'on'" @click='addAddress'><text class='iconfont icon-tianjiadizhi'></text>添加新地址</view>
<view v-if="this.$wechat.isWeixin()" class='addressBnt wxbnt' @click='getAddress'><text class='iconfont icon-weixin2'></text>导入微信地址</view>
<view class='addressBnt bg_color' :class="this.$wechat.isWeixin()?'':'on'" @click='addAddress'><text
class='iconfont icon-tianjiadizhi'></text>添加新地址</view>
<view v-if="this.$wechat.isWeixin()" class='addressBnt wxbnt' @click='getAddress'><text
class='iconfont icon-weixin2'></text>导入微信地址</view>
<!-- #endif -->
<!-- #ifdef APP-->
<view class='addressBnt on bg-color' @click='addAddress'><text class='iconfont icon-tianjiadizhi'></text>添加新地址</view>
<!-- #endif -->
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<atModel v-if="locationStatus" :locationType="true" @closeModel="modelCancel" @confirmModel="confirmModel"
:content="locationContent"></atModel>
<!-- #endif -->
<home></home>
</view>
</template>
@@ -76,22 +74,18 @@
import {
toLogin
} from '@/libs/login.js';
import atModel from '@/components/accredit/index.vue';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import home from '@/components/home';
let app = getApp();
export default {
components: {
// #ifdef MP
authorize,
// #endif
home
atModel
},
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
addressList: [],
cartId: '',
pinkId: 0,
@@ -101,32 +95,28 @@
loadTitle: '加载更多',
page: 1,
limit: 20,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
bargain: false, //是否是砍价
combination: false, //是否是拼团
secKill: false, //是否是秒杀
theme: app.globalData.theme,
locationContent: '授权位置信息,提供完整服务',
locationStatus: false
};
},
computed: mapGetters(['isLogin']),
watch:{
isLogin:{
handler:function(newV,oldV){
if(newV){
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getUserAddress(true);
}
},
deep:true
deep: true
}
},
onLoad(options) {
if (this.isLogin) {
this.preOrderNo = options.preOrderNo || 0;
// this.pinkId = options.pinkId || 0;
// this.couponId = options.couponId || 0;
// this.secKill = options.secKill || false;
// this.combination = options.combination || false;
// this.bargain = options.bargain || false;
this.getAddressList(true);
} else {
toLogin();
@@ -137,12 +127,22 @@
that.getAddressList(true);
},
methods: {
onLoadFun: function() {
this.getAddressList();
modelCancel() {
this.locationStatus = false;
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
confirmModel() {
uni.getLocation({
type: 'gcj02',
altitude: true,
geocode: true,
success: function(res) {
try {
uni.setStorageSync('user_latitude', res.latitude);
uni.setStorageSync('user_longitude', res.longitude);
} catch {}
}
});
this.locationStatus = false;
},
/*
* 导入微信地址(小程序)
@@ -161,7 +161,7 @@
addressP.cityId = 0;
editAddress({
address: addressP,
isDefault: true,
isDefault: false,
realName: res.userName,
postCode: res.postalCode,
phone: res.telNumber,
@@ -169,12 +169,13 @@
id: 0
//type: 1//区别城市id导入微信地址无城市id需要后台自己查找;
}).then(res => {
that.$util.Tips({
title: "添加成功",
icon: 'success'
}, function() {
setTimeout(() => {
that.getAddressList(true);
});
that.$util.Tips({
title: "添加成功",
icon: 'success'
});
}, 0)
}).catch(err => {
return that.$util.Tips({
title: err
@@ -182,9 +183,10 @@
});
},
fail: function(res) {
if (res.errMsg == 'chooseAddress:cancel') return that.$util.Tips({
title: '取消选择'
});
if (res.errMsg == 'chooseAddress:cancel') return that.$util
.Tips({
title: '取消选择'
});
},
})
},
@@ -227,16 +229,16 @@
},
detail: userInfo.detailInfo,
postCode: userInfo.postalCode,
isDefault: true
isDefault: false,
})
.then(() => {
that.$util.Tips({
title: "添加成功",
icon: 'success'
}, function() {
// close();
setTimeout(() => {
that.getAddressList(true);
});
that.$util.Tips({
title: "添加成功",
icon: 'success'
});
}, 0)
})
.catch(err => {
// close();
@@ -244,6 +246,10 @@
title: err || "添加失败"
});
});
}).catch(err => {
that.$util.Tips({
title: err.errMsg || "添加失败"
});
});
},
/**
@@ -270,7 +276,7 @@
that.addressList = that.$util.SplitArray(list, that.addressList);
that.$set(that, 'addressList', that.addressList);
that.loadend = loadend;
that.loadTitle = loadend ? '我也是有底线的' : '加载更多';
that.loadTitle = loadend ? '我也是有底线的~' : '加载更多';
that.page = that.page + 1;
that.loading = false;
}).catch(err => {
@@ -316,8 +322,10 @@
this.pinkId = '';
this.couponId = '';
uni.navigateTo({
url: '/pages/users/user_address/index?id=' + id + '&cartId=' + cartId + '&pinkId=' + pinkId + '&couponId=' +
couponId + '&secKill' + this.secKill + '&combination=' + this.combination + '&bargain=' + this.bargain
url: '/pages/users/user_address/index?id=' + id + '&cartId=' + cartId + '&pinkId=' +
pinkId + '&couponId=' +
couponId + '&secKill' + this.secKill + '&combination=' + this.combination +
'&bargain=' + this.bargain
})
},
/**
@@ -329,19 +337,31 @@
if (address == undefined) return that.$util.Tips({
title: '您删除的地址不存在!'
});
delAddress(address.id).then(res => {
that.$util.Tips({
title: '删除成功',
icon: 'success'
}, function() {
that.addressList.splice(index, 1);
that.$set(that, 'addressList', that.addressList);
});
}).catch(err => {
return that.$util.Tips({
title: err
});
});
uni.showModal({
content: '确定删除该地址',
cancelText: "取消", // 取消按钮的文字
confirmText: "确定", // 确认按钮文字
showCancel: true, // 是否显示取消按钮,默认为 true
confirmColor: '#f55850',
success: (res) => {
if (res.confirm) {
delAddress(address.id).then(res => {
that.addressList.splice(index, 1);
that.$set(that, 'addressList', that.addressList);
that.$util.Tips({
title: '删除成功',
icon: 'success'
});
}).catch(err => {
return that.$util.Tips({
title: err
});
});
} else {
}
},
})
},
/**
* 新增地址
@@ -357,13 +377,14 @@
url: '/pages/users/user_address/index?preOrderNo=' + this.preOrderNo
})
},
goOrder: function(id) {
if(this.preOrderNo){
goOrder: function(item) {
if (this.preOrderNo) {
uni.redirectTo({
url: '/pages/users/order_confirm/index?is_address=1&preOrderNo=' + this.preOrderNo + '&addressId=' + id
url: '/pages/order/order_confirm/index?is_address=1&preOrderNo=' + this.preOrderNo +
'&addressId=' + item.id
})
}
}
},
},
onReachBottom: function() {
this.getAddressList();
@@ -372,23 +393,30 @@
</script>
<style lang="scss" scoped>
.address-management{
.address-management {
padding: 20rpx 30rpx;
}
.address-management.fff {
background-color: #fff;
height: 1300rpx
}
.bg_color {
@include main_bg_color(theme);
}
.line {
width: 100%;
height: 3rpx;
image {
width: 100%;
height: 100%;
display: block;
}
}
.address-management .item {
background-color: #fff;
padding: 0 20rpx;
@@ -434,7 +462,7 @@
font-size: 38rpx;
}
.footer {
.footer {
position: fixed;
width: 100%;
background-color: #fff;
@@ -444,7 +472,7 @@
box-sizing: border-box;
}
.footer .addressBnt {
.footer .addressBnt {
width: 330rpx;
height: 76rpx;
border-radius: 50rpx;
@@ -454,24 +482,28 @@
color: #fff;
}
.footer .addressBnt.on {
.footer .addressBnt.on {
width: 690rpx;
margin: 0 auto;
}
.footer .addressBnt .iconfont {
.footer .addressBnt .iconfont {
font-size: 35rpx;
margin-right: 8rpx;
vertical-align: -1rpx;
}
.footer .addressBnt.wxbnt {
background-color: #fe960f;
.footer .addressBnt.wxbnt {
@include left_color(theme);
}
.status_1{
display: flex;
width: 750rpx;
// background-color: #E93323;
height: var(--status-bar-height);
/deep/ radio .wx-radio-input.wx-radio-input-checked {
@include main_bg_color(theme);
@include coupons_border_color(theme);
}
</style>
/deep/ radio .uni-radio-input.uni-radio-input-checked {
@include main_bg_color(theme);
border: none !important;
}
</style>

View File

@@ -1,5 +1,5 @@
<template>
<view>
<view :data-theme="theme">
<view class='bill-details'>
<view class='nav acea-row'>
<view class='item' :class='type==="all" ? "on":""' @click='changeType("all")'>全部</view>
@@ -11,13 +11,14 @@
<view class='item'>
<view class='data'>{{item.date}}</view>
<view class='listn borRadius14'>
<view class='itemn acea-row row-between-wrapper' v-for="(vo,indexn) in item.list" :key="indexn">
<view class='itemn acea-row row-between-wrapper' v-for="(vo,indexn) in item.list"
:key="indexn">
<view>
<view class='name line1'>{{vo.title}}</view>
<view>{{vo.add_time}}</view>
</view>
<view class='num' v-if="vo.pm">+{{vo.number}}</view>
<view class='num font-color' v-else>-{{vo.number}}</view>
<view class='num font_color' v-if="vo.pm">+{{vo.number}}</view>
<view class='num' v-else>-{{vo.number}}</view>
</view>
</view>
</view>
@@ -30,10 +31,6 @@
</view>
</view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
@@ -47,18 +44,11 @@
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import emptyPage from '@/components/emptyPage.vue';
import home from '@/components/home';
let app = getApp();
export default {
components: {
// #ifdef MP
authorize,
// #endif
emptyPage,
home
emptyPage
},
data() {
return {
@@ -66,11 +56,10 @@
loading: false,
loadend: false,
page: 1,
limit: 10,
limit: 12,
type: 'all',
userBillList: [],
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
theme:app.globalData.theme,
};
},
computed: mapGetters(['isLogin']),
@@ -85,7 +74,7 @@
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.type = options.type;
this.type = options.type?options.type:'all';
},
/**
* 页面上拉触底事件的处理函数
@@ -94,23 +83,13 @@
this.getUserBillList();
},
methods: {
/**
* 授权回调
*/
onLoadFun: function() {
this.getUserBillList();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
/**
* 获取账户明细
*/
getUserBillList: function() {
let that = this;
if (that.loadend) return;
if (that.loading) return;
that.loading = true;
that.loadTitle = "";
@@ -120,14 +99,34 @@
type: that.type
}
getBillList(data).then(function(res) {
let list = res.data.list?res.data.list:[],
loadend = res.data.list < res.data.limit;
that.userBillList = that.$util.SplitArray(list, that.userBillList);
that.$set(that, 'userBillList', that.userBillList);
let list = res.data.list ? res.data.list : [],
loadend = res.data.totalPage <= that.page;
for (let i = 0; i < list.length; i++) {
let time1 = list[i].date;
let array1 = list[i].list;
let isEquals = false;
for (let j = 0; j < that.userBillList.length; j++) {
let time2 = that.userBillList[j].date;
let array2 = that.userBillList[j].list;
if (time1 == time2) {
array2.push.apply(array2, array1);
that.userBillList[j].list = array2;
isEquals = true;
break;
}
}
if (!isEquals) {
that.userBillList.push({
date: time1,
list: array1
})
}
}
that.$set(that, 'userBillList', that.userBillList);
that.page += 1;
that.loadend = loadend;
that.loading = false;
that.loadTitle = loadend ? "哼😕~我也是有底线的~" : "加载更多";
that.page = that.page + 1;
that.loadTitle = loadend ? "我也是有底线的~" : "加载更多";
}, function(res) {
that.loading = false;
that.loadTitle = '加载更多';
@@ -148,16 +147,14 @@
</script>
<style scoped lang='scss'>
.sign-record{
}
.sign-record {}
.bill-details .nav {
background-color: #fff;
height: 90rpx;
width: 100%;
line-height: 90rpx;
}
.bill-details .nav .item {
flex: 1;
text-align: center;
@@ -166,7 +163,10 @@
}
.bill-details .nav .item.on {
color: $theme-color;
border-bottom: 3rpx solid $theme-color;
@include main_color(theme);
@include tab_border_bottom(theme);
}
.font_color{
color: #E93323 !important;
}
</style>

View File

@@ -1,11 +1,11 @@
<template>
<view>
<view :data-theme="theme">
<view class='cash-withdrawal'>
<view class='nav acea-row'>
<view v-for="(item,index) in navList" :key="index" class='item font-color' @click="swichNav(index)">
<view class='line bg-color' :class='currentTab==index ? "on":""'></view>
<view class='line bg_color' :class='currentTab==index ? "on":""'></view>
<view class='iconfont' :class='item.icon+" "+(currentTab==index ? "on":"")'></view>
<view>{{item.name}}</view>
<view class="tab_text">{{item.name}}</view>
</view>
</view>
<view class='wrapper'>
@@ -13,11 +13,15 @@
<form @submit="subCash" report-submit='true'>
<view class='item acea-row row-between-wrapper'>
<view class='name'>持卡人</view>
<view class='input'><input placeholder='请输入持卡人姓名' placeholder-class='placeholder' name="name"></input></view>
<view class='input'>
<input placeholder='请输入持卡人姓名' placeholder-class='placeholder' name="name" maxlength="20"></input>
</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='name'>卡号</view>
<view class='input'><input type='number' placeholder='请填写卡号' placeholder-class='placeholder' name="cardum"></input></view>
<view class='input'>
<input type='number' placeholder='请填写卡号' placeholder-class='placeholder' name="cardum" maxlength="19"></input>
</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='name'>银行</view>
@@ -45,11 +49,15 @@
<form @submit="subCash" report-submit='true'>
<view class='item acea-row row-between-wrapper'>
<view class='name'>账号</view>
<view class='input'><input placeholder='请填写您的微信账号' placeholder-class='placeholder' name="name"></input></view>
<view class='input'>
<input placeholder='请填写您的微信账号' placeholder-class='placeholder' name="name" maxlength="20"></input>
</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='name'>提现</view>
<view class='input'><input :placeholder='"最低提现金额"+minPrice' placeholder-class='placeholder' name="money" type='digit'></input></view>
<view class='input'>
<input :placeholder='"最低提现金额"+minPrice' placeholder-class='placeholder' name="money" type='digit' maxlength="5"></input>
</view>
</view>
<view class='item acea-row row-top row-between'>
<view class='name'>收款码</view>
@@ -73,43 +81,8 @@
<button formType="submit" class='bnt bg-color'>提现</button>
</form>
</view>
<view :hidden='currentTab != 2' class='list'>
<form @submit="subCash" report-submit='true'>
<view class='item acea-row row-between-wrapper'>
<view class='name'>账号</view>
<view class='input'><input placeholder='请填写您的支付宝账号' placeholder-class='placeholder' name="name"></input></view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='name'>提现</view>
<view class='input'><input :placeholder='"最低提现金额"+minPrice' placeholder-class='placeholder' name="money" type='digit'></input></view>
</view>
<view class='item acea-row row-top row-between'>
<view class='name'>收款码</view>
<view class="input acea-row">
<view class="picEwm" v-if="qrcodeUrlZ">
<image :src="qrcodeUrlZ"></image>
<text class='iconfont icon-guanbi1 font-color' @click='DelPicZ'></text>
</view>
<view class='pictrue acea-row row-center-wrapper row-column' @click='uploadpic("Z")' v-else>
<text class='iconfont icon-icon25201'></text>
<view>上传图片</view>
</view>
</view>
</view>
<view class='tip'>
当前可提现金额: <text class="price">{{commission.commissionCount}},</text>冻结佣金{{commission.brokenCommission}}
</view>
<view class='tip'>
说明: 每笔佣金的冻结期为{{commission.brokenDay}}到期后可提现
</view>
<button formType="submit" class='bnt bg-color'>提现</button>
</form>
</view>
</view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
@@ -125,15 +98,9 @@
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import {Debounce} from '@/utils/validate.js'
let app = getApp();
export default {
components: {
// #ifdef MP
authorize
// #endif
},
data() {
return {
navList: [{
@@ -144,10 +111,6 @@
'name': '微信',
'icon': 'icon-weixin2'
},
{
'name': '支付宝',
'icon': 'icon-icon34'
}
],
currentTab: 0,
index: 0,
@@ -155,12 +118,11 @@
minPrice: 0.00, //最低提现金额
userInfo: [],
isClone: false,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
commission:{},
qrcodeUrlW:"",
qrcodeUrlZ:"",
isCommitted: false //防止多次提交
isCommitted: false, //防止多次提交
theme:app.globalData.theme,
};
},
computed: mapGetters(['isLogin']),
@@ -187,7 +149,7 @@
uploadpic: function (type) {
let that = this;
that.$util.uploadImageOne({
url: 'user/upload/image',
url: 'upload/image',
name: 'multipart',
model: "user",
pid: 1
@@ -209,19 +171,12 @@
DelPicZ: function () {
this.qrcodeUrlZ = "";
},
onLoadFun: function() {
this.getUserExtractBank();
},
getExtractUser(){
extractUser().then(res=>{
this.commission = res.data;
this.minPrice = res.data.minPrice;
})
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
getUserExtractBank: function() {
let that = this;
extractBank().then(res => {
@@ -245,7 +200,7 @@
})
},
subCash: function(e) {
subCash: Debounce(function(e) {
let that = this,
value = e.detail.value;
if (that.currentTab == 0) { //银行卡
@@ -267,13 +222,6 @@
});
value.wechat = value.name;
value.qrcodeUrl = that.qrcodeUrlW;
} else if (that.currentTab == 2) { //支付宝
value.extractType = 'alipay';
if (value.name.length == 0) return this.$util.Tips({
title: '请填写账号'
});
value.alipayCode = value.name;
value.qrcodeUrl = that.qrcodeUrlZ;
}
if (value.money.length == 0) return this.$util.Tips({
title: '请填写提现金额'
@@ -290,7 +238,7 @@
return this.$util.Tips({
title: "提现成功",
icon: 'success'
},{ tab: 2, url: '/pages/users/user_spread_user/index' });
},{ tab: 2, url: '/pages/promoter/user_spread_user/index' });
this.isCommitted=false;
}).catch(err => {
this.isCommitted=false;
@@ -299,7 +247,7 @@
});
});
}
}
})
}
}
</script>
@@ -328,7 +276,8 @@
width: 40rpx;
height: 40rpx;
border-radius: 50%;
border: 2rpx solid $theme-color;
@include coupons_border_color(theme);
@include main_color(theme);
text-align: center;
line-height: 37rpx;
margin: 0 auto 6rpx auto;
@@ -337,9 +286,10 @@
}
.cash-withdrawal .nav .item .iconfont.on {
background-color: $theme-color;
color: #fff;
border-color: $theme-color;
@include main_bg_color(theme);
color: #fff !important;
@include coupons_border_color(theme);
// border-color: $theme-color;
}
.cash-withdrawal .nav .item .line {
@@ -348,7 +298,12 @@
margin: 0 auto;
transition: height 0.3s;
}
.tab_text{
@include main_color(theme);
}
.bg_color{
@include main_bg_color(theme);
}
.cash-withdrawal .nav .item .line.on {
height: 39rpx;
}
@@ -425,6 +380,7 @@
border-radius: 50rpx;
line-height: 90rpx;
margin: 64rpx auto;
@include main_bg_color(theme);
}
.cash-withdrawal .wrapper .list .tip2 {
@@ -454,6 +410,6 @@
}
.price {
color: $theme-color;
@include price_color(theme);
}
</style>

View File

@@ -1,13 +1,13 @@
<template>
<view>
<view :data-theme="theme">
<view class="navbar acea-row row-around">
<view class="item acea-row row-center-wrapper" :class="{ on: navOn === 'usable' }" @click="onNav('usable')">未使用</view>
<view class="item acea-row row-center-wrapper" :class="{ on: navOn === 'unusable' }" @click="onNav('unusable')">已使用/过期</view>
</view>
<view class='coupon-list' v-if="couponsList.length">
<view class='item acea-row row-center-wrapper' v-for='(item,index) in couponsList' :key="index">
<view class='money' :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart' ? 'moneyGray' : ''">
<view><text class='num'>{{item.money?Number(item.money):''}}</text></view>
<view class='money' :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart' ? 'moneyGray' : 'main_bg'">
<view><text class='num':style="[{'font-size':item.money.length>=7?'42rpx':'60rpx'}]" >{{item.money?Number(item.money):''}}</text></view>
<view class="pic-num">{{ item.minPrice?Number(item.minPrice):'' }}元可用</view>
</view>
<view class='text'>
@@ -19,7 +19,7 @@
</view>
<view class='data acea-row row-between-wrapper'>
<view>{{item.useStartTimeStr}}~{{item.useEndTimeStr}}</view>
<view class='bnt' :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart'?'gray':'bg-color'">{{item.validStr | validStrFilter}}</view>
<view class='bnt' :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart'?'gray':'bg_color'">{{item.validStr | validStrFilter}}</view>
</view>
</view>
</view>
@@ -29,13 +29,9 @@
</view>
<view class='noCommodity' v-if="!couponsList.length">
<view class='pictrue'>
<image src='../../../static/images/noCoupon.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/noCoupon.png'"></image>
</view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
@@ -49,17 +45,8 @@
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import home from '@/components/home';
let app = getApp();
export default {
components: {
// #ifdef MP
authorize,
// #endif
home
},
filters: {
validStrFilter(status) {
const statusMap = {
@@ -73,6 +60,7 @@
},
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
couponsList: [],
loading: false,
loadend: false,
@@ -80,8 +68,7 @@
page: 1,
limit: 20,
navOn: 'usable',
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
theme:app.globalData.theme,
};
},
computed: mapGetters(['isLogin']),
@@ -103,16 +90,6 @@
}
},
methods: {
/**
* 授权回调
*/
onLoadFun: function() {
this.getUseCoupons();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
onNav: function(type) {
this.navOn = type;
this.couponsList = [];
@@ -132,7 +109,7 @@
let couponsList = that.$util.SplitArray(list, that.couponsList);
that.$set(that,'couponsList',couponsList);
that.loadend = loadend;
that.loadTitle = loadend ? '我也是有底线的' : '加载更多';
that.loadTitle = loadend ? '我也是有底线的~' : '加载更多';
that.page = that.page + 1;
that.loading = false;
}).catch(err=>{
@@ -165,19 +142,22 @@
border-bottom: 5rpx solid transparent;
font-size: 30rpx;
color: #999999;
&.on {
border-bottom-color: #E93323;
color: #282828;
&.on{
@include tab_border_bottom(theme);
@include main_color(theme);
}
}
}
.money {
display: flex;
flex-direction: column;
justify-content: center;
}
.bg_color{
@include main_bg_color(theme);
}
.pic-num {
color: #ffffff;
font-size: 24rpx;
@@ -199,15 +179,17 @@
padding: 2rpx 10rpx;
-webkit-box-sizing: border-box;
box-sizing: border-box;
background: rgba(255, 247, 247, 1);
border: 1px solid rgba(232, 51, 35, 1);
@include coupons_border_color(theme);
opacity: 1;
border-radius: 20rpx;
font-size: 18rpx !important;
color: #e83323;
@include main_color(theme);
margin-right: 12rpx;
}
.noCommodity {
margin-top: 300rpx;
}
.main_bg{
@include main_bg_color(theme);
}
</style>

View File

@@ -1,51 +1,44 @@
<template>
<view>
<view :data-theme="theme">
<view class="acea-row row-around nav">
<template v-for="item in navList">
<view :key="item.type" :class="['acea-row', 'row-middle', type === item.type ? 'on' : '']"
@click="setType(item.type)">{{ item.name }}</view>
<view :key="item.type" :class="['acea-row', 'row-middle', type === item.type ? 'on' : '']" >
<text @click="setType(item.type)">{{ item.name }}</text>
</view>
</template>
</view>
<view style="height: 106rpx;"></view>
<view class='coupon-list' v-if="couponsList.length">
<view class='item acea-row row-center-wrapper' v-for="(item,index) in couponsList" :key="index">
<view class='money' :class='item.isUse ? "moneyGray" : "" '>
<view><text class='num'>{{item.money?Number(item.money):''}}</text></view>
<view class='money' :class='item.isUse ? "moneyGray" : "main_bg" '>
<view ><text class='num' :style="[{'font-size':item.money.length>=7?'42rpx':'60rpx'}]" >{{item.money?Number(item.money):''}}</text></view>
<view class="pic-num">{{item.minPrice?Number(item.minPrice):''}}元可用</view>
</view>
<view class='text'>
<view class='condition line2'>
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":""'
v-if='item.useType===1'>通用</span>
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":""'
v-else-if='item.useType===3'>品类</span>
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":""' v-else>商品</span>
<span>{{item.name}}</span>
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":"select"' v-if='item.useType===1'>通用</span>
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":"select"' v-else-if='item.useType===3'>品类</span>
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":"select"' v-else>商品</span>
<span>{{item.name}}</span>
</view>
<view class='data acea-row row-between-wrapper'>
<view v-if="item.day>0">领取后{{item.day}}天内可用</view>
<view v-else>
{{ item.useStartTimeStr&& item.useEndTimeStr ? item.useStartTimeStr + " - " + item.useEndTimeStr : ""}}
</view>
<view v-else>{{ item.useStartTimeStr&& item.useEndTimeStr ? item.useStartTimeStr + " - " + item.useEndTimeStr : ""}}</view>
<view class='bnt gray' v-if="item.isUse==true">已领取</view>
<view class='bnt bg-color' v-else @click='getCoupon(item.id,index)'>立即领取</view>
<view class='bnt main_bg' v-else @click='getCoupon(item.id,index)'>立即领取</view>
</view>
</view>
</view>
</view>
<view class='loadingicon acea-row row-center-wrapper'>
<text class='loading iconfont icon-jiazai'
:hidden='loading==false'></text>{{couponsList.length?loadTitle:''}}
</view>
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{couponsList.length?loadTitle:''}}
</view>
<view class='noCommodity' v-if="!couponsList.length && isShow && !loading">
<view class='pictrue'>
<image src='../../../static/images/noCoupon.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/noCoupon.png'"></image>
</view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</view>
</template>
<script>
@@ -56,142 +49,118 @@
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
export default {
components: {
// #ifdef MP
authorize
// #endif
},
data() {
return {
couponsList: [],
loading: false,
loadend: false,
loadTitle: '加载更多', //提示语
page: 1,
limit: 20,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
type: 1,
isShow: false,
navList: [{
type: 1,
name: '通用券',
count: 0
import {
mapGetters
} from "vuex";
let app = getApp();
export default {
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
couponsList:[],
loading: false,
loadend: false,
loadTitle: '加载更多',//提示语
page: 1,
limit: 20,
type: 1,
isShow: false,
navList: [{
type: 1,
name: '通用券',
count: 0
},
{
type: 2,
name: '商品券',
count: 0
},
{
type: 3,
name: '品类券',
count: 0
},
],
count: 0,
theme:app.globalData.theme,
};
},
computed: mapGetters(['isLogin']),
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getUseCoupons();
}
},
{
type: 2,
name: '商品券',
count: 0
},
{
type: 3,
name: '品类券',
count: 0
},
],
count: 0
};
},
computed: mapGetters(['isLogin']),
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getUseCoupons();
}
},
deep: true
}
},
onLoad() {
if (this.isLogin) {
this.getUseCoupons();
} else {
toLogin();
}
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
this.getUseCoupons();
},
methods: {
onLoadFun() {
this.getUseCoupons();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
getCoupon: function(id, index) {
let that = this;
let list = that.couponsList;
let ids = [];
ids.push(id);
//领取优惠券
setCouponReceive(id).then(function(res) {
list[index].isUse = true;
that.$set(that, 'couponsList', list);
that.$util.Tips({
title: '领取成功'
});
}, function(res) {
return that.$util.Tips({
title: res
});
})
},
/**
* 获取领取优惠券列表
*/
getUseCoupons: function() {
let that = this
if (that.loadend) return false;
if (that.loading) return false;
that.loading = true;
getCoupons({
page: that.page,
limit: that.limit,
type: that.type
}).then(res => {
let list = res.data,
loadend = list.length < that.limit;
let couponsList = that.$util.SplitArray(list, that.couponsList);
that.$set(that, 'couponsList', couponsList);
that.loadend = loadend;
that.loadTitle = loadend ? '我也是有底线的' : '加载更多';
that.page = that.page + 1;
that.loading = false;
that.isShow = true;
}).catch(err => {
that.loading = false;
that.loadTitle = '加载更多';
});
},
setType: function(type) {
if (this.type !== type) {
this.type = type;
this.couponsList = [];
this.page = 1;
this.loadend = false;
this.getUseCoupons();
deep: true
}
},
onLoad(){
if(this.isLogin){
this.getUseCoupons();
}else{
toLogin();
}
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.getUseCoupons();
},
methods: {
getCoupon:function(id,index){
let that = this;
let list = that.couponsList;
let ids = [];
ids.push(id);
//领取优惠券
setCouponReceive(id).then(function (res) {
list[index].isUse = true;
that.$set(that,'couponsList',list);
that.$util.Tips({ title: '领取成功' });
},function(res){
return that.$util.Tips({title:res});
})
},
/**
* 获取领取优惠券列表
*/
getUseCoupons:function(){
let that=this
if(that.loadend) return false;
if(that.loading) return false;
that.loading = true;
getCoupons({ page: that.page, limit: that.limit, type: that.type }).then(res=>{
let list=res.data.list,loadend=list.length < that.limit;
let couponsList = that.$util.SplitArray(list, that.couponsList);
that.$set(that,'couponsList',couponsList);
that.loadend = loadend;
that.loadTitle = loadend ? '我也是有底线的~' : '加载更多';
that.page = that.page + 1;
that.loading = false;
that.isShow = true;
}).catch(err=>{
that.loading = false;
that.loadTitle = '加载更多';
});
},
setType: function(type) {
if (this.type !== type) {
this.type = type;
this.couponsList = [];
this.page = 1;
this.loadend = false;
this.getUseCoupons();
}
}
}
}
}
</script>
<style scoped>
<style scoped lang="scss">
.nav {
position: fixed;
top: 0;
@@ -203,39 +172,42 @@
color: #999999;
z-index: 9;
}
.nav .acea-row {
border-top: 5rpx solid transparent;
border-bottom: 5rpx solid transparent;
cursor: pointer;
}
.nav .acea-row.on {
border-bottom-color: #E93323;
color: #E93323;
@include tab_border_bottom(theme);
@include main_color(theme);
}
.condition .line-title {
width: 90rpx;
padding: 0 10rpx;
box-sizing: border-box;
background: rgba(255, 247, 247, 1);
border: 1px solid rgba(232, 51, 35, 1);
opacity: 1;
border-radius: 20rpx;
font-size: 20rpx;
color: #E83323;
margin-right: 12rpx;
.condition .line-title{
width:90rpx;
padding: 0 10rpx;
box-sizing: border-box;
background:#fff;
opacity:1;
border-radius:20rpx;
font-size:20rpx;
margin-right: 12rpx;
}
.condition .line-title.gray {
border-color: #BBB;
color: #bbb;
background-color: #F5F5F5;
.condition .line-title.gray{
border:1px solid #BBB;
color:#bbb;
background-color:#F5F5F5;
}
.coupon-list .pic-num {
color: #FFFFFF;
font-size: 24rpx;
.coupon-list .pic-num{
color: #FFFFFF;
font-size: 24rpx;
}
.main_bg{
@include main_bg_color(theme);
}
.select{
@include main_color(theme);
@include coupons_border_color(theme);
}
</style>

View File

@@ -1,30 +1,46 @@
<template>
<view>
<view class="hdbj"></view>
<view :data-theme="theme">
<view class='collectionGoods' v-if="collectProductList.length">
<!-- #ifdef H5 || MP-->
<view class='nav acea-row row-between-wrapper'>
<view>当前共 <text class='num font-color'>{{ totals }}</text>件商品</view>
<view>当前共 <text class='num font_color'>{{ totals }}</text>件商品</view>
<view class='administrate acea-row row-center-wrapper' @click='manage'>{{ footerswitch ? '管理' : '取消'}}
</view>
</view>
<!-- #endif -->
<view class="list">
<checkbox-group @change="checkboxChange" class="centent">
<!-- #ifndef APP-PLUS-->
<view v-for="(item,index) in collectProductList" :key="index" class='item acea-row row-middle'>
<checkbox :value="item.id.toString()" :checked="item.checked" v-if="!footerswitch"
style="margin-right: 10rpx;" />
<navigator :url='"/pages/goods_details/index?id="+item.productId' hover-class='none'
<navigator :url='"/pages/goods/goods_details/index?id="+item.productId' hover-class='none'
class="acea-row">
<view class='pictrue'>
<image :src="item.image"></image>
</view>
<view>
<view class='name line1'>{{item.storeName}}</view>
<view class='money font-color'>{{item.price}}</view>
<view class='money'>{{item.price}}</view>
</view>
</navigator>
</view>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<view v-for="(item,index) in collectProductList" :key="index" :data-index="index"
class='item acea-row row-middle order-item'>
<navigator :url='"/pages/goods/goods_details/index?id="+item.productId' hover-class='none' class="acea-row">
<view class='pictrue'>
<image :src="item.image"></image>
</view>
<view>
<view class='name line1'>{{item.storeName}}</view>
<view class='money'>{{item.price}}</view>
</view>
</navigator>
<view class="remove borRadius14" @tap="delCollection(item.id)">删除</view>
</view>
<!-- #endif -->
</checkbox-group>
</view>
<view class='loadingicon acea-row row-center-wrapper'>
@@ -32,9 +48,9 @@
</view>
<view v-if="!footerswitch" class='footer acea-row row-between-wrapper'>
<view>
<checkbox-group @change="checkboxAllChange">
<checkbox-group @change="checkboxAllChange" class="acea-row row-middle">
<checkbox value="all" :checked="!!isAllSelect" />
<text class='checkAll'>全选</text>
<text @click="isAllSelectChange" class='checkAll'>{{isAllSelect?'取消':'全选'}}</text>
</checkbox-group>
</view>
<view class='button acea-row row-middle'>
@@ -46,14 +62,10 @@
</view>
<view class='noCommodity' v-else-if="!collectProductList.length && page > 1">
<view class='pictrue'>
<image src='../static/noCollection.png'></image>
<image :src="urlDomain+'crmebimage/perset/usersImg/noCollection.png'"></image>
</view>
<recommend :hostProduct="hostProduct"></recommend>
<recommend ref="recommendIndex"></recommend>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
@@ -70,46 +82,35 @@
toLogin
} from '@/libs/login.js';
import recommend from '@/components/recommend';
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import home from '@/components/home';
let app = getApp();
export default {
components: {
recommend,
// #ifdef MP
authorize,
// #endif
home
recommend
},
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
footerswitch: true,
hostProduct: [],
loadTitle: '加载更多',
loading: false,
loadend: false,
collectProductList: [],
limit: 8,
page: 1,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
hotScroll: false,
hotPage: 1,
hotLimit: 10,
isAllSelect: false, //全选
selectValue: [], //选中的数据
delBtnWidth: 80, //左滑默认宽度
totals: 0
totals: 0,
theme:app.globalData.theme,
};
},
computed: mapGetters(['isLogin']),
onLoad() {
let that = this;
if (this.isLogin) {
this.loadend = false;
this.page = 1;
this.collectProductList = [];
this.get_user_collect_product();
} else {
toLogin();
}
@@ -121,35 +122,6 @@
this.get_user_collect_product();
},
methods: {
// #ifdef MP
drawStart(e) {
var touch = e.touches[0];
this.startX = touch.clientX;
},
//触摸滑动
drawMove(e) {
var touch = e.touches[0];
var item = this.collectProductList[e.currentTarget.dataset.index];
var disX = this.startX - touch.clientX;
if (disX >= 20) {
if (disX > this.delBtnWidth) {
disX = this.delBtnWidth;
}
this.$set(this.collectProductList[e.currentTarget.dataset.index], 'right', disX);
} else {
this.$set(this.collectProductList[e.currentTarget.dataset.index], 'right', 0);
}
},
//触摸滑动结束
drawEnd(e) {
var item = this.collectProductList[e.currentTarget.dataset.index];
if (item.right >= this.delBtnWidth / 2) {
this.$set(this.collectProductList[e.currentTarget.dataset.index], 'right', this.delBtnWidth);
} else {
this.$set(this.collectProductList[e.currentTarget.dataset.index], 'right', 0);
}
},
// #endif
manage: function() {
this.footerswitch = !this.footerswitch;
},
@@ -176,6 +148,14 @@
this.setAllSelectValue(0)
}
},
isAllSelectChange(){
this.isAllSelect=!this.isAllSelect
if(this.isAllSelect){
this.setAllSelectValue(1)
}else{
this.setAllSelectValue(0)
}
},
setAllSelectValue: function(status) {
let selectValue = [];
if (this.collectProductList.length > 0) {
@@ -192,17 +172,6 @@
this.selectValue = selectValue.toString();
}
},
/**
* 授权回调
*/
onLoadFun: function() {
this.get_user_collect_product();
this.get_host_product();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
/**
* 获取收藏产品
*/
@@ -225,9 +194,8 @@
that.collectProductList = that.$util.SplitArray(collectProductList, that
.collectProductList);
that.$set(that, 'collectProductList', that.collectProductList);
if (that.collectProductList.length === 0) that.get_host_product();
that.loadend = loadend;
that.loadTitle = loadend ? '我也是有底线的' : '加载更多';
that.loadTitle = loadend ? '我也是有底线的~' : '加载更多';
that.page = that.page + 1;
that.loading = false;
}).catch(err => {
@@ -258,7 +226,7 @@
title: '取消收藏成功',
icon: 'success'
});
// this.collectProductList = this.collectProductList.filter(item=>item!==this.selectValue)
this.selectValue = [];
this.collectProductList = [];
this.loadend = false;
this.page = 1;
@@ -269,43 +237,22 @@
})
});
},
/**
* 获取我的推荐
*/
get_host_product: function() {
let that = this;
if (that.hotScroll) return
getProductHot(
that.hotPage,
that.hotLimit,
).then(res => {
that.hotPage++
that.hotScroll = res.data.list.length < that.hotLimit
that.hostProduct = that.hostProduct.concat(res.data.list)
});
}
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
this.get_user_collect_product();
this.get_host_product();
this.$refs.recommendIndex.get_host_product();
}
}
</script>
<style scoped lang="scss">
.hdbj {
width: 100%;
height: 30rpx;
background-color: #f5f5f5;
z-index: 999999;
position: fixed;
top: 0;
.money{
font-size: 26rpx;
@include price_color(theme);
}
.order-item {
width: 100%;
display: flex;
@@ -316,12 +263,12 @@
.remove {
width: 120rpx;
height: 100%;
background-color: $theme-color;
color: white;
height: 40rpx;
@include main_bg_color(theme);
color: #fff;
position: absolute;
top: 0;
right: -160rpx;
bottom: 30rpx;
right: 60rpx;
display: flex;
justify-content: center;
align-items: center;
@@ -350,10 +297,18 @@
.list {
padding: 30rpx;
/* #ifndef APP-PLUS*/
margin-top: 90rpx;
/* #endif */
/* #ifdef MP */
//margin-top: 0rpx;
/* #endif */
.name {
width: 434rpx;
/* #ifdef APP-PLUS */
width: 486rpx;
/* #endif */
margin-bottom: 56rpx;
}
}
@@ -399,10 +354,6 @@
width: 100%;
}
.collectionGoods .item .text .money {
font-size: 26rpx;
}
.collectionGoods .item .text .delete {
font-size: 26rpx;
color: #282828;
@@ -433,7 +384,11 @@
/* #ifdef H5 || MP */
bottom: 0rpx;
/* #endif */
/* #ifndef MP */
/* #ifdef APP-PLUS */
bottom: 0;
/* #endif */
/* #ifndef MP || APP-PLUS */
// bottom: 98rpx;
// bottom: calc(98rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
// bottom: calc(98rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
@@ -455,4 +410,19 @@
line-height: 60rpx;
}
}
.font_color{
@include main_color(theme);
}
/deep/ checkbox .uni-checkbox-input.uni-checkbox-input-checked {
@include main_bg_color(theme);
@include coupons_border_color(theme);
color: #fff!important
}
/deep/ checkbox .wx-checkbox-input.wx-checkbox-input-checked {
@include main_bg_color(theme);
@include coupons_border_color(theme);
color: #fff!important;
margin-right: 0 !important;
}
</style>

View File

@@ -1,380 +0,0 @@
<template>
<view>
<form @submit="formSubmit" report-submit='true'>
<view class='personal-data pad30'>
<view class='list borRadius14'>
<view class="item acea-row row-between-wrapper">
<view>头像</view>
<view class="pictrue" @click.stop='uploadpic'>
<image :src='newAvatar ? newAvatar : userInfo.avatar'></image>
<image src='../../../static/images/alter.png' class="alter"></image>
</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view>昵称</view>
<view class='input'><input type='text' name='nickname' :value='userInfo.nickname'></input>
</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view>手机号码</view>
<navigator url="/pages/users/app_login/index" hover-class="none" class="input"
v-if="!userInfo.phone">
点击绑定手机号<text class="iconfont icon-xiangyou"></text>
</navigator>
<navigator url="/pages/users/user_phone/index" hover-class="none" class="input" v-else>
<view class='input acea-row row-between-wrapper'>
<input type='text' disabled='true' name='phone' :value='userInfo.phone'
class='id'></input>
<text class='iconfont icon-xiangyou'></text>
</view>
</navigator>
<!-- <navigator url="/pages/users/user_phone/index" hover-class="none" class="input" v-if="!memberInfo.phone">
点击绑定手机号<text class="iconfont icon-xiangyou"></text>
</navigator>
<view class='input acea-row row-between-wrapper' v-else>
<input type='text' disabled='true' name='phone' :value='memberInfo.phone' class='id'></input>
<text class='iconfont icon-suozi'></text>
</view> -->
</view>
<view class='item acea-row row-between-wrapper'>
<view>ID号</view>
<view class='input acea-row row-between-wrapper'>
<input type='text' :value='uid' disabled='true' class='id'></input>
<text class='iconfont icon-suozi'></text>
</view>
</view>
<!-- #ifdef MP -->
<view class='item acea-row row-between-wrapper'>
<view>权限设置</view>
<view class="input" @click="Setting">
点击管理<text class="iconfont icon-xiangyou"></text>
</view>
</view>
<!-- #endif -->
<view class="item acea-row row-between-wrapper" v-if="userInfo.phone">
<view>密码</view>
<navigator url="/pages/users/user_pwd_edit/index" hover-class="none" class="input">
点击修改密码<text class="iconfont icon-xiangyou"></text>
</navigator>
</view>
</view>
<button class='modifyBnt bg-color' formType="submit">保存修改</button>
<!-- #ifdef H5 -->
<view class="logOut cart-color acea-row row-center-wrapper" @click="outLogin"
v-if="!this.$wechat.isWeixin()">退出登录</view>
<!-- #endif -->
</view>
</form>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
<script>
import {
userEdit,
getLogout
} from '@/api/user.js';
import {
switchH5Login
} from '@/api/api.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
import dayjs from "@/plugin/dayjs/dayjs.min.js";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
export default {
components: {
// #ifdef MP
authorize
// #endif
},
data() {
return {
memberInfo: {},
loginType: 'h5', //app.globalData.loginType
userIndex: 0,
newAvatar: '',
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
};
},
computed: mapGetters(['isLogin', 'uid', 'userInfo']),
onLoad() {
if (!this.isLogin) {
toLogin();
}
},
methods: {
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
/**
* 小程序设置
*/
Setting: function() {
uni.openSetting({
success: function(res) {
console.log(res.authSetting)
}
});
},
/**
* 退出登录
*
*/
outLogin: function() {
let that = this;
if (that.loginType == 'h5') {
uni.showModal({
title: '提示',
content: '确认退出登录?',
success: function(res) {
if (res.confirm) {
getLogout()
.then(res => {
that.$store.commit("LOGOUT");
uni.reLaunch({
url: '/pages/index/index'
});
})
.catch(err => {
console.log(err);
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
},
/**
* 上传文件
*
*/
uploadpic: function() {
let that = this;
that.$util.uploadImageOne({
url: 'user/upload/image',
name: 'multipart',
model: "maintain",
pid: 0
}, function(res) {
that.newAvatar = res.data.url;
});
},
/**
* 提交修改
*/
formSubmit: function(e) {
let that = this,
value = e.detail.value
if (!value.nickname) return that.$util.Tips({
title: '用户姓名不能为空'
});
value.avatar = that.newAvatar?that.newAvatar:that.userInfo.avatar;
userEdit(value).then(res => {
that.$store.commit("changInfo", {
amount1: 'avatar',
amount2: that.newAvatar
});
return that.$util.Tips({
title: '更换头像已成功',
icon: 'success'
}, {
tab: 3,
url: 1
});
}).catch(msg => {
return that.$util.Tips({
title: msg || '保存失败,您并没有修改'
}, {
tab: 3,
url: 1
});
});
}
}
}
</script>
<style scoped lang="scss">
.personal-data .wrapper {
margin: 10rpx 0;
background-color: #fff;
padding: 36rpx 30rpx 13rpx 30rpx;
}
.personal-data .wrapper .title {
margin-bottom: 30rpx;
font-size: 32rpx;
color: #282828;
}
.personal-data .wrapper .wrapList .item {
width: 690rpx;
height: 160rpx;
background-color: #f8f8f8;
border-radius: 20rpx;
margin-bottom: 22rpx;
padding: 0 30rpx;
position: relative;
border: 2rpx solid #f8f8f8;
box-sizing: border-box;
}
.personal-data .wrapper .wrapList .item.on {
border-color: $theme-color;
border-radius: 20rpx;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArIAAACgCAYAAADw+I85AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6M0QzNkY3NzlCNzJCMTFFOTgyNEU4QzhGQTRFRUY2REQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6M0QzNkY3N0FCNzJCMTFFOTgyNEU4QzhGQTRFRUY2REQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozRDM2Rjc3N0I3MkIxMUU5ODI0RThDOEZBNEVFRjZERCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozRDM2Rjc3OEI3MkIxMUU5ODI0RThDOEZBNEVFRjZERCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pn3rJMAAAArUSURBVHja7N3NXuLIGsDhqigK2Ou+grmEuf/t2fT+bOYKZn9aW5Q6qaQSIoKfoCQ8z29QRBSBzX+q31RiSikAAMDYVF4CAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQBAyAIAIGQBAEDIAgCAkAUAQMgCAMAJuPQSAABMy79///XaXfJi5qy0YFUuqVzW9eWhvqzK9b1+/vpHyAIAcMjCqxs1tldj/zHl/6oU4rz+ctY2a3tzjO2n0F6tUqobMYZ5fX1V337XBm0MMbX3SuXnvv1peqcBAKYlXl+VSI2lZJuIzSuwi7pUY3/HFPsijYMPcVOps9hG7W19fRVT+50YT6TXvdUAABML2at5V6rdTdfNSmzXquX2FOKTr7trsVvBjeVOISzLyuyfNnNTOIWWFbIAAFNzfd2umjYrsmlWR+i8KuusXbhurudZgTZpU6w/p82Ka0oldJvb47z+cp3HDU5kQVbIAgBMTVwsmzitr1V1ni5C07Pd5EAXtCVlm3BNTfS27dvGbAiDcYPUr9TWvys91jetT2BEVsgCAEwuZOeLJkDr/+Z5sbXdb7UdCIixb9M2WDdjss2n4X274YN2LraJ3fzjeUTh9yk8TyELADC1kM0rsjHVTRpnTYam2I8LNBOuaRO0TbaWbQhidyRYKveLmz0P+vu223ZV8ZWtuYQsAADvD9nlTTMb23/dxelg9TUM4nSzRLvZsSANf274u9uvZnXm/hGyAAAcVHWzzKusl5uDtvq9YtvvpzZJmwGC+GS1tR83iHuGYMuPXtbfF7IAABxWXP7IyVkNT4awGQ/Y7FswHBkIW9e7W1Kfv0/GDKpTeJ5CFgBgapbLPAJQxX5X2DIuEPsdYtsSTak/nKv5Xir7GQxWZNvvlZGC/pReUcgCAHB41c2PnbfHrc+v3bbv61MhZAEAJibmkE1pXRdo9SRDuxXVuJWp3XBsGYDdfL9frx38jub767LVgZAFAOCAIdvsWpBjs5tlHZx4tvmQNhsVdH1bAjYO9pTtrlX9cEJvfQrPU8gCAExMdXOTPz3knQvCk/1iU4iDhO3HCuKT8yK0v6P/mfL9wTFf9W0PpzBvIGQBACYmLm7yOMCqDtB5f6hXak94UFo0lPMklO22ykFfg71mNyu3/ZkUNltz1b+7vYOQBQDgkCG7vMmxmWdkVyGfiWvH3rD9yWeb22O/KVdfuqVy29HZOBwuWKVmbEHIAgBw6JBdLMqKaryLMV3GwRFcqRykVXWt2g0V9KfyimV7rsEEbTkILLbDCXftqIGDvQAAOLTFsjtxwbrOzds6PJcpPT8pQnctlV6N/XlsBwd9lZXcsp/sbZXiuszJClkAAA4rzuclUpsl11UdoXcxxXm709Zg7rUp1fJ13KzKDnbfGhwQFu/qr1fdoGwUsgAAHD5kF32JlhD9E5ots+KiCv0JvAZzr3GzPUGJ235lNo8TpHjbBnF373QSz1PIAgBMLWSvrtoQTf3ga5YP0nqsP89jPgCs7dz2Q4xhu03T5mfuYnNyhTjYzSAE228BALDXv3//9aGf+/mf/5ai3Zy0q4wOrGOIv1NoznEwq0P3sv66yl+XLs0ztfV9wkOO2NieVKFP29SeKqyP2I/+fUIWAIDdZrP+6nDhdDMa0JyZ60+57LvPM9+0CJsfttq6NMetCVkAgIn57pXST0Zr7tOLEqzd552ELAAA3x2u3aV6zw8LWQAAvlKO1Vm5XHzmFwlZAABGE69CFgDgDb5z1vTnr3+m8BLmcL06VnMKWQCAwzRVt9rYHVWf5c2r8g4Bef/WVWi3tZq6WF6L6/DOmVchCwDwdcGWY+0q7N+ZKpa4vSj3y2F7H9ptr9IZvh5CFgDgm+UVx8UHgm0Ye7ehXaUVsEIWAOBLLEq0fTb+lqFdnb0d8WtxXS7fcq4EIQsA8HY5Pmc7bs9jAt0MbJ6HXZe460YLuhna7eDrVjF/j+x1yM9lHo48AytkAQAOY7EnYu9Cu7KadsRtd7DXqtzvqgTgdhTm3z2Gldmq/K0n0ZBCFgDgdd02UkM5UPNK6uMbf0eO2nyQV161XYanq5lX5fZTnpn91jGCfVUNAMB+OdwWOyL2f++I2KHH8rPrrds/cvDYV/XiTWhXkuOp/WEAAOy3axXy944QfY9uNXc7mK9P7Lnnlegf4UT/FV/IAgC8bHukII8HPB7g9z6W3/XSY32nvEK8DKe5SixkAQBecbkVcmlHfH7G9okRYvj+1c/chz9OLKqFLADAO23vUrAKhz0jV7dt10uP+dXhniP2YgxvjpAFANhvO+gejvAYD6885lfJK7D5oK44ljfH9lsAAPttL/o9HuExHl95zK+QdyS4HtubI2QBAPbbXp1cH+Ex1q885rEd4pS7J/F/GQAAvD1sx260EStkAQBelr4gZKtXHvNYlmOOWCELAPCy7X/2P8aBWBevPOYx5JXY2djfHCELALDf9oFYxzi+6PKVxzxGxF5N4c0RsgAA++3a4/WQ4wUxPF8ZfTji85lPJWKFLADAy3JUbp9565DbVF2H52cOWx3puczCCLfYErIAAB93vyM+DzEre7EjLO+P9Bzy+MJyam+MkAUAeNmf8HwngeUnO6raEZapPNYxem85xTdGyAIAvCwH5u2Ohsqnc/3IyuxF+dntDrsNh996K5aIjVN8Y4QsAMDr8tzq/Y6O+hHaA6jeEoqx3PfHjga7D8eZjZ2H42wZdhKcohYA4G1uw+5dBvKc61UJ0XxZh81esFW5zML+HQ9W4fmK7yHMwoR2KBCyAACf8zvs3oc1ltveG473R4rYqvydkyZkAQDeJ4fnQwnFj86ednO3x9pq6zN/m5AFAJiwVYnZbqzgrdGYAzavwu7aCeFQrs6l8YQsAMDH5BC9K5fcVHkmNR9YVQ3CNt8nz8s+DuL3mPJjz8/lDRCyAACf9/AFkfoWZzFSIGQBAF7x89c/Y/pzZ+fWdvaRBQCYhvm5PWEhCwAwftfn2HVCFgBg3GIJ2bMjZAEAxu06nNEBXkIWAGAaujOKnSUhCwAwXme7GitkAQDG66xXY2tJyAIAjNMsnPFqbG0tZAEAxun6zJ+/kAUAGKF8Bq9z77hHIQsAMD5XXoLwIGQBAMYlz8XOzvw1WAcrsgAAo2M1NoRV/iBkAQDGZeYlCPdCFgBgXHK7XYjYZrRAyAIAjMi5r8am+nI3rHoAAITsGNyWmBWyAAAjkncrOOexgjxSsBreIGQBAMbh8oyfew7Y2+0bhSwAgJA9ZQ+7Ivbcyx4AQMietvt9EStkAQDGIc/HntO/pKcSsCtlDwAwbufUbHkV9i4MdifwogAAjNfUdyvIJzhYhcHJDtQ9AMA0TGmsIJVYzZfH0B7M9fiRX/R/AQYA1i4UF+HkevkAAAAASUVORK5CYII=");
background-size: 100% 100%;
background-color: #fff9f9;
background-repeat: no-repeat;
}
.personal-data .wrapper .wrapList .item .picTxt {
width: 445rpx;
}
.personal-data .wrapper .wrapList .item .picTxt .pictrue {
width: 96rpx;
height: 96rpx;
position: relative;
}
.personal-data .wrapper .wrapList .item .picTxt .pictrue image {
width: 100%;
height: 100%;
border-radius: 50%;
}
.personal-data .wrapper .wrapList .item .picTxt .pictrue .alter {
width: 30rpx;
height: 30rpx;
border-radius: 50%;
position: absolute;
bottom: 0;
right: 0;
}
.personal-data .wrapper .wrapList .item .picTxt .text {
width: 325rpx;
}
.personal-data .wrapper .wrapList .item .picTxt .text .name {
width: 100%;
font-size: 30rpx;
color: #282828;
}
.personal-data .wrapper .wrapList .item .picTxt .text .phone {
font-size: 24rpx;
color: #999;
margin-top: 10rpx;
}
.personal-data .wrapper .wrapList .item .bnt {
font-size: 24rpx;
background-color: #fff;
border-radius: 27rpx;
width: 140rpx;
height: 54rpx;
border: 2rpx solid $theme-color;
}
.personal-data .wrapper .wrapList .item .currentBnt {
position: absolute;
right: 0;
top: 0;
font-size: 26rpx;
background-color: rgba(233, 51, 35, 0.1);
width: 140rpx;
height: 48rpx;
border-radius: 0 20rpx 0 20rpx;
}
.personal-data .list {
margin-top: 30rpx;
background-color: #fff;
}
.personal-data .list .item {
border-bottom: 1rpx solid #f2f2f2;
padding: 24rpx;
font-size: 32rpx;
color: #282828;
}
.personal-data .list .item .phone {
width: 160rpx;
height: 56rpx;
font-size: 24rpx;
color: #fff;
line-height: 56rpx;
border-radius: 32rpx
}
.personal-data .list .item .pictrue {
width: 88rpx;
height: 88rpx;
position: relative;
}
.personal-data .list .item .pictrue image {
width: 100%;
height: 100%;
border-radius: 50%;
}
.personal-data .list .item .pictrue .alter {
width: 30rpx;
height: 30rpx;
border-radius: 50%;
position: absolute;
bottom: 0;
right: 0;
}
.personal-data .list .item .input {
width: 415rpx;
text-align: right;
color: #868686;
}
.personal-data .list .item .input .id {
width: 365rpx;
}
.personal-data .list .item .input .iconfont {
font-size: 35rpx;
}
.personal-data .modifyBnt {
font-size: 32rpx;
color: #fff;
width: 690rpx;
height: 90rpx;
border-radius: 50rpx;
text-align: center;
line-height: 90rpx;
margin: 76rpx auto 0 auto;
}
.personal-data .logOut {
font-size: 32rpx;
text-align: center;
width: 690rpx;
height: 90rpx;
border-radius: 45rpx;
margin: 30rpx auto 0 auto;
}
</style>

View File

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
<template>
<view>
<view :data-theme="theme">
<view class='my-account'>
<view class='wrapper'>
<view class='header'>
@@ -9,26 +9,13 @@
<view>总资产()</view>
<view class='money'>{{statistics.nowMoney || 0}}</view>
</view>
<!-- #ifdef H5 -->
<navigator url="/pages/users/user_payment/index" hover-class="none" class='recharge font-color'>充值</navigator>
<!-- #endif -->
<!-- #ifdef MP -->
<view v-if="userInfo.rechargeSwitch" @click="openSubscribe('/pages/users/user_payment/index')" class='recharge font-color'>充值</view>
<!-- #endif -->
</view>
<view v-if="userInfo.rechargeSwitch" @click="openSubscribe('/pages/users/user_payment/index')" class='recharge font_color'>充值</view>
</view>
<view class='cumulative acea-row row-top'>
<!-- #ifdef H5 -->
<view class='item'>
<view>累计充值()</view>
<view class='money'>{{statistics.recharge || 0}}</view>
</view>
<!-- #endif -->
<!-- #ifdef MP -->
<view class='item' v-if="userInfo.rechargeSwitch">
<view>累计充值()</view>
<view class='money'>{{statistics.recharge || 0}}</view>
</view>
<!-- #endif -->
<view class='item'>
<view>累计消费()</view>
<view class='money'>{{statistics.orderStatusSum || 0}}</view>
@@ -39,25 +26,25 @@
<view class='nav acea-row row-middle'>
<navigator class='item' hover-class='none' url='/pages/users/user_bill/index?type=all'>
<view class='pictrue'>
<image src='../../../static/images/record1.png'></image>
<text class="iconfont icon-s-zhangdanjilu icon_txt"></text>
</view>
<view>账单记录</view>
</navigator>
<navigator class='item' hover-class='none' url='/pages/users/user_bill/index?type=expenditure'>
<view class='pictrue'>
<image src='../../../static/images/record2.png'></image>
<text class="iconfont icon-s-xiaofeijilu icon_txt"></text>
</view>
<view>消费记录</view>
</navigator>
<navigator class='item' hover-class='none' url='/pages/users/user_bill/index?type=income' v-if="userInfo.rechargeSwitch">
<view class='pictrue'>
<image src='../../../static/images/record3.png'></image>
<text class="iconfont icon-s-chongzhijilu icon_txt"></text>
</view>
<view>充值记录</view>
</navigator>
<navigator class='item' hover-class='none' url='/pages/users/user_integral/index'>
<view class='pictrue'>
<image src='../../../static/images/record4.png'></image>
<text class="iconfont icon-jifenzhongxin icon_txt"></text>
</view>
<view>积分中心</view>
</navigator>
@@ -69,7 +56,7 @@
<view>赚积分抵现金</view>
</view>
<view class='pictrue'>
<image src='../../../static/images/gift.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/gift.png'"></image>
</view>
</navigator>
<navigator class='item on acea-row row-between-wrapper' hover-class='none' url='/pages/users/user_get_coupon/index'>
@@ -78,96 +65,40 @@
<view>满减享优惠</view>
</view>
<view class='pictrue'>
<image src='../../../static/images/money.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/money.png'"></image>
</view>
</navigator>
</view>
<!-- <view class='list'>
<view class='item acea-row row-between-wrapper'>
<view class='picTxt acea-row row-between-wrapper'>
<view class='iconfont icon-hebingxingzhuang'></view>
<view class='text'>
<view class='line1'>最新拼团活动</view>
<view class='infor line1'>最新的优惠商品上架拼团</view>
</view>
</view>
<navigator hover-class='none' url='/pages/activity/goods_combination/index' class='bnt' v-if="activity.is_pink">立即参与</navigator>
<view class='bnt end' v-else>已结束</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='picTxt acea-row row-between-wrapper'>
<view class='iconfont icon-miaosha yellow'></view>
<view class='text'>
<view class='line1'>当前限时秒杀</view>
<view class='infor line1'>最新商品秒杀进行中</view>
</view>
</view>
<navigator hover-class='none' url='/pages/activity/goods_seckill/index' class='bnt' v-if="activity.is_seckill">立即参与</navigator>
<view class='bnt end' v-else>已结束</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='picTxt acea-row row-between-wrapper'>
<view class='iconfont icon-kanjia1 green'></view>
<view class='text'>
<view class='line1'>砍价活动</view>
<view class='infor line1'>呼朋唤友来砍价</view>
</view>
</view>
<navigator hover-class='none' url='/pages/activity/goods_bargain/index' class='bnt' v-if="activity.is_bargin">立即参与</navigator>
<view class='bnt end' v-else>已结束</view>
</view>
</view> -->
</view>
<recommend :hostProduct="hostProduct" v-if="hostProduct.length"></recommend>
<recommend ref="recommendIndex" @getRecommendLength="getRecommendLength"></recommend>
<view class='noCommodity' v-if="isNoCommodity">
<view class='pictrue'>
<image :src="urlDomain+'crmebimage/perset/staticImg/noSearch.png'"></image>
</view>
</view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
<script>
import {
getProductHot
} from '@/api/store.js';
import {
openRechargeSubscribe
} from '@/utils/SubscribeMessage.js';
import {
userActivity,
getuserDalance
} from '@/api/user.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
import {userActivity,getuserDalance} from '@/api/user.js';
import {toLogin} from '@/libs/login.js';
import {mapGetters} from "vuex";
import recommend from '@/components/recommend/index';
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import home from '@/components/home';
let app = getApp();
export default {
components: {
recommend,
// #ifdef MP
authorize,
// #endif
home
recommend
},
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
hostProduct: [],
isClose: false,
activity: {},
isAuto: false, //没有授权的不会自动授权
isShowAuth: false ,//是否隐藏授权
hotScroll:false,
statistics:{},
hotPage:1,
hotLimit:10
theme:app.globalData.theme,
isNoCommodity: false // 是否显示缺省图
};
},
computed: mapGetters(['isLogin', 'userInfo']),
@@ -175,7 +106,6 @@
isLogin:{
handler:function(newV,oldV){
if(newV){
this.get_host_product();
this.get_activity();
this.userDalance();
}
@@ -185,7 +115,21 @@
},
onLoad() {
if (this.isLogin) {
this.get_host_product();
// #ifdef H5
var url = window.location.search;
if(url){
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
var strs = str.split("&");
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1]);
}
}
this.orderId = theRequest.out_trade_no; //返回的订单号
// this.alipayQueryPay();
}
// #endif
this.get_activity();
this.userDalance();
} else {
@@ -193,8 +137,10 @@
}
},
methods: {
getRecommendLength(e) {
this.isNoCommodity = e == 0 ? true : false;
},
onLoadFun: function() {
this.get_host_product();
this.get_activity();
this.userDalance();
},
@@ -207,21 +153,11 @@
authColse: function(e) {
this.isShowAuth = e
},
// #ifdef MP
openSubscribe: function(page) {
uni.showLoading({
title: '正在加载',
})
openRechargeSubscribe().then(res => {
uni.hideLoading();
uni.navigateTo({
url: page,
});
}).catch(() => {
uni.hideLoading();
uni.navigateTo({
url: page,
});
},
// #endif
/**
* 获取活动可参与否
*/
@@ -230,25 +166,10 @@
// userActivity().then(res => {
// that.$set(that, "activity", res.data);
// })
},
/**
* 获取我的推荐
*/
get_host_product: function() {
let that = this;
if(that.hotScroll) return
getProductHot(
that.hotPage,
that.hotLimit,
).then(res => {
that.hotPage++
that.hotScroll = res.data.list.length<that.hotLimit
that.hostProduct = that.hostProduct.concat(res.data.list)
});
}
},
onReachBottom() {
this.get_host_product();
this.$refs.recommendIndex.get_host_product();
}
}
</script>
@@ -263,7 +184,7 @@
.my-account .wrapper .header {
width: 690rpx;
height: 330rpx;
background-image: linear-gradient(to right, #f33b2b 0%, #f36053 100%);
@include main_bg_color(theme);
border-radius: 16rpx;
margin: 0 auto;
box-sizing: border-box;
@@ -300,7 +221,14 @@
text-align: center;
line-height: 54rpx;
}
.font_color{
@include main_color(theme);
}
.icon_txt{
font-size: 43rpx;
@include main_color(theme);
}
.my-account .wrapper .header .headerCon .cumulative {
margin-top: 46rpx;
}

View File

@@ -1,8 +1,8 @@
<template>
<view>
<view :data-theme="theme" class="user_payment">
<form @submit="submitSub" report-submit='true'>
<view class="payment-top acea-row row-column row-center-wrapper">
<span class="name">我的余额</span>
<span class="name1">我的余额</span>
<view class="pic">
<span class="pic-font">{{ userInfo.nowMoney || 0 }}</span>
</view>
@@ -20,7 +20,7 @@
<view class="pic-number">赠送{{ item.giveMoney }} </view>
</view>
<view class="pic-box pic-box-color acea-row row-center-wrapper" :class="parseFloat(activePic)===parseFloat(picList.length)?'pic-box-color-active':''" @click="picCharge(picList.length)">
<input type="number" placeholder="其他" v-model="money" :maxlength="50000" class="pic-box-money pic-number-pic uni-input" :class="parseFloat(activePic) === parseFloat(picList.length) ? 'pic-box-color-active' : ''" />
<input type="number" placeholder="其他" v-model="money" maxlength="5" class="pic-box-money pic-number-pic uni-input" :class="parseFloat(activePic) === parseFloat(picList.length) ? 'pic-box-color-active' : ''" @blur="addMoney()" />
</view>
<view class="tips-box">
<view class="tips mt-30">注意事项</view>
@@ -30,7 +30,8 @@
</view>
</view>
<view class="tip" v-else>
<view class='input'><text></text><input placeholder="0.00" type='number' placeholder-class='placeholder' :value="number"
<view class='input'><text></text>
<input placeholder="0.00" type='number' placeholder-class='placeholder' :value="number"
name="number"></input></view>
<view class="tips-title">
<view style="font-weight: bold; font-size: 26rpx;">提示</view>
@@ -43,13 +44,30 @@
</view>
</view>
</view>
<!-- #ifndef MP-->
<view class='wrapper borRadius14 px-30' v-if='!active'>
<view class='item'>
<view>支付方式</view>
<view class='list'>
<view class='payItem acea-row row-middle' :class='curActive==index ?"on":""'
@tap='payItem(index)' v-for="(item,index) in cartArr" :key='index'
v-if="item.payStatus===1">
<view class='name acea-row row-center-wrapper'>
<view class='iconfont animated'
:class='(item.icon) + " " + (animated==true&&active==index ?"bounceIn":"")'>
</view>
{{item.name}}
</view>
<view class='tip'>{{item.title}}</view>
</view>
</view>
</view>
</view>
<!-- #endif -->
<button class='but' formType="submit"> {{active ? '立即转入': '立即充值' }}</button>
<view class="alipaysubmit" v-html="formContent"></view>
</view>
</form>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
@@ -59,26 +77,18 @@
rechargeWechat,
getRechargeApi,
transferIn,
appWechat
appWechat,
} from '@/api/user.js';
import { wechatQueryPayResult } from '@/api/order.js';
import { wechatQueryPayResult,getOrderPayConfig} from '@/api/order.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import home from '@/components/home';
import {Debounce} from '@/utils/validate.js'
let app = getApp();
export default {
components: {
// #ifdef MP
authorize,
// #endif
home
},
data() {
let that = this;
return {
@@ -88,14 +98,32 @@
number: '',
placeholder: "0.00",
from: '',
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
picList: [],
activePic: 0,
money: "",
numberPic: '',
rechar_id: 0,
rechargeAttention: []
rechargeAttention: [],
theme:app.globalData.theme,
//支付方式
cartArr: [{
"name": "微信支付",
"icon": "icon-weixin2",
value: 'weixin',
title: '微信快捷支付',
// #ifdef APP
payStatus: 0,
// #endif
// #ifndef APP
payStatus: 1,
// #endif
},
],
payType: 'weixin', //支付方式
openType: 1, //优惠券打开方式 1=使用
curActive: 0, //支付方式切换
animated: false,
formContent:''
};
},
computed: mapGetters(['isLogin', 'systemPlatform','userInfo']),
@@ -113,14 +141,17 @@
// #ifdef H5
this.from = this.$wechat.isWeixin() ? "public" : "weixinh5";
// #endif
// #ifdef APP-PLUS
this.from = this.systemPlatform === 'ios' ? 'weixinAppIos' : 'weixinAppAndroid';
// #endif
if (this.isLogin) {
this.getRecharge();
this.payConfig();
} else {
toLogin();
}
},
methods: {
/**
* 选择金额
*/
@@ -156,24 +187,32 @@
});
});
},
onLoadFun: function() {
this.getRecharge();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
// 支付配置
payConfig(){
getOrderPayConfig().then(res=>{
this.cartArr[0].payStatus = res.data.payWechatOpen ? 1 : 0;
// #ifndef MP
// this.cartArr[1].payStatus = res.data.aliPayStatus ? 1 : 0;
// #endif
if(this.$wechat.isWeixin()) this.cartArr.pop();
})
},
navRecharges: function(index) {
this.active = index;
},
payItem: function(e) {
let that = this;
let active = e;
that.curActive = active;
that.animated = true;
that.payType = that.cartArr[active].value;
},
/*
* 用户充值
*/
submitSub: function(e) {
submitSub: Debounce(function(e) {
let that = this
let value = e.detail.value.number;
let value = e.detail.value.number ? e.detail.value.number :that.numberPic;
// 转入余额
if (that.active) {
if (parseFloat(value) < 0 || parseFloat(value) == NaN || value == undefined || value == "") {
@@ -236,131 +275,176 @@
} else {
money = this.numberPic
}
// #ifdef MP
rechargeRoutine({
price: money,
type: 0,
rechar_id: this.rechar_id
}).then(res => {
uni.hideLoading();
let jsConfig = res.data.data.jsConfig;
uni.requestPayment({
timeStamp: jsConfig.timeStamp,
nonceStr: jsConfig.nonceStr,
package: jsConfig.packages,
signType: jsConfig.signType,
paySign: jsConfig.paySign,
success: function(res) {
that.$store.commit("changInfo", {
amount1: 'nowMoney',
amount2: that.$util.$h.Add(value, that.userinfo.nowMoney)
});
//that.$set(that, 'userinfo.nowMoney', that.$util.$h.Add(value, that.userinfo.nowMoney));
return that.$util.Tips({
title: '支付成功',
icon: 'success'
}, {
tab: 5,
url: '/pages/users/user_money/index'
});
},
fail: function(err) {
return that.$util.Tips({
title: '支付失败'
});
},
complete: function(res) {
if (res.errMsg == 'requestPayment:cancel') return that.$util.Tips({
title: '取消支付'
});
}
})
}).catch(err => {
uni.hideLoading();
return that.$util.Tips({
title: err
})
});
// #endif
// #ifdef H5
rechargeWechat({
price: money,
from: that.from,
rechar_id: that.rechar_id,
payType: 0
}).then(res => {
let jsConfig = res.data.jsConfig;
let orderNo = res.data.orderNo;
let data = {
timestamp:jsConfig.timeStamp,
nonceStr:jsConfig.nonceStr,
package:jsConfig.packages,
signType:jsConfig.signType,
paySign:jsConfig.paySign
};
if (that.from == "weixinh5") {
let domain = encodeURIComponent(location.href.split('/pages')[0]);
let urls = jsConfig.mwebUrl + '&redirect_url='+ domain + '/pages/users/user_money/index';
location.replace(urls);
return that.$util.Tips({
tab: 5,
url: '/pages/users/user_money/index'
});
// return that.$util.Tips({
// title: '支付成功',
// icon: 'success'
// }, {
// tab: 5,
// url: '/pages/users/user_money/index'
// });
} else {
that.$wechat.pay(data)
.finally(() => {
switch (that.payType){
case 'weixin':
// #ifdef APP-PLUS
appWechat({
from: that.from,
price: money,
type: 0,
rechar_id: this.rechar_id
}).then(res => {
uni.hideLoading();
let jsConfig = res.data.jsConfig;
uni.requestPayment({
provider: 'wxpay',
orderInfo: {
"appid": jsConfig.appId, // 微信开放平台 - 应用 - AppId注意和微信小程序、公众号 AppId 可能不一致
"noncestr": jsConfig.nonceStr, // 随机字符串
"package": "Sign=WXPay", // 固定值
"partnerid": jsConfig.partnerid, // 微信支付商户号
"prepayid": jsConfig.packages, // 统一下单订单号
"timestamp": Number(jsConfig.timeStamp), // 时间戳(单位:秒)
"sign": this.systemPlatform === 'ios' ? 'MD5' : jsConfig.paySign // 签名,这里用的 MD5 签名
}, //订单数据 【注意微信的订单信息,键值应该全部是小写,不能采用驼峰命名】
success: function(res) {
that.$store.commit("changInfo", {
amount1: 'nowMoney',
amount2: that.$util.$h.Add(value, that.userinfo.nowMoney)
amount2: that.$util.$h.Add(value, that.userInfo.nowMoney)
});
// that.$set(that, 'userinfo.nowMoney', that.$util.$h.Add(value, that.userinfo.nowMoney));
wechatQueryPayResult(orderNo).then(res => {
return that.$util.Tips({
title: '支付成功',
icon: 'success'
}, {
tab: 5,
url: '/pages/users/user_money/index'
});
}).cache(err => {
return that.$util.Tips({
title: err
});
})
})
.catch(function(err) {
return that.$util.Tips({
title: '支付成功',
icon: 'success'
}, {
tab: 5,
url: '/pages/users/user_money/index'
});
},
fail: function(err) {
return that.$util.Tips({
title: '支付失败'
});
});
}
}).catch(res=>{
uni.hideLoading();
return that.$util.Tips({
title: res
},
complete: function(res) {
if (res.errMsg == 'requestPayment:cancel') return that.$util.Tips({
title: '取消支付'
});
}
})
}).catch(err => {
uni.hideLoading();
return that.$util.Tips({
title: err
})
});
})
// #endif
// #endif
// #ifdef MP
rechargeRoutine({
price: money,
type: 0,
rechar_id: this.rechar_id
}).then(res => {
uni.hideLoading();
let jsConfig = res.data.data.jsConfig;
uni.requestPayment({
timeStamp: jsConfig.timeStamp,
nonceStr: jsConfig.nonceStr,
package: jsConfig.packages,
signType: jsConfig.signType,
paySign: jsConfig.paySign,
success: function(res) {
that.$store.commit("changInfo", {
amount1: 'nowMoney',
amount2: that.$util.$h.Add(value, that.userInfo.nowMoney)
});
return that.$util.Tips({
title: '支付成功',
icon: 'success'
}, {
tab: 5,
url: '/pages/users/user_money/index'
});
},
fail: function(err) {
return that.$util.Tips({
title: '支付失败'
});
},
complete: function(res) {
if (res.errMsg == 'requestPayment:cancel') return that.$util.Tips({
title: '取消支付'
});
}
})
}).catch(err => {
uni.hideLoading();
return that.$util.Tips({
title: err
})
});
// #endif
// #ifdef H5
rechargeWechat({
price: money,
from: that.from,
rechar_id: that.rechar_id,
payType: 0
}).then(res => {
let jsConfig = res.data.jsConfig;
let orderNo = res.data.orderNo;
let data = {
timestamp:jsConfig.timeStamp,
nonceStr:jsConfig.nonceStr,
package:jsConfig.packages,
signType:jsConfig.signType,
paySign:jsConfig.paySign
};
if (that.from == "weixinh5") {
uni.hideLoading();
that.$util.Tips({
title: '支付成功'
}, {
tab: 5,
url:'/pages/users/user_money/index'
});
setTimeout(() => {
location.href = jsConfig.mwebUrl;
}, 100)
} else {
that.$wechat.pay(data)
.finally(() => {
that.$store.commit("changInfo", {
amount1: 'nowMoney',
amount2: that.$util.$h.Add(value, that.userInfo.nowMoney)
});
return that.$util.Tips({
title: '支付成功',
icon: 'success'
}, {
tab: 5,
url: '/pages/users/user_money/index'
});
})
.catch(function(err) {
return that.$util.Tips({
title: '支付失败'
});
});
}
}).catch(res=>{
uni.hideLoading();
return that.$util.Tips({
title: res
});
})
// #endif
break;
}
}
}),
addMoney(){
this.money = this.money.replace(/[^\d]/g,'').replace(/^0{1,}/g,'');
}
}
}
</script>
<style lang="scss">
page {
width: 100%;
height: 100%;
.user_payment{
height: 100vh;
background-color: #fff;
}
.payment {
position: relative;
top: -60rpx;
@@ -385,7 +469,7 @@
.payment .nav .item.on {
font-weight: bold;
border-bottom: 4rpx solid #e83323;
@include tab_border_bottom(theme);
}
.payment .input {
@@ -423,7 +507,7 @@
font-size: 26rpx;
color: #888888;
padding: 0 30rpx;
margin-top: 25rpx;
// margin-top: 25rpx;
}
.payment .but {
@@ -433,16 +517,16 @@
height: 86rpx;
border-radius: 43rpx;
margin: 50rpx auto 0 auto;
background: linear-gradient(90deg, #FF7931 0%, #F11B09 100%);
@include linear-gradient(theme);
line-height: 86rpx;
}
.payment-top {
width: 100%;
height: 350rpx;
background-color: #e83323;
@include main_bg_color(theme);
.name {
.name1 {
font-size: 26rpx;
color: rgba(255, 255, 255, 0.8);
margin-top: -38rpx;
@@ -495,7 +579,7 @@
}
.pic-box-color-active {
background-color: #ec3323 !important;
@include linear-gradient(theme);
color: #fff !important;
}
.tips-box {
@@ -523,4 +607,71 @@
font-size: 24rpx;
color: #333;
}
.wrapper .item textarea {
background-color: #f9f9f9;
width: auto !important;
height: 140rpx;
border-radius: 14rpx;
margin-top: 30rpx;
padding: 15rpx;
box-sizing: border-box;
font-weight: 400;
}
.px-30{
padding-left: 30rpx;
padding-rigt: 30rpx;
}
.wrapper .item .placeholder {
color: #ccc;
}
.wrapper .item .list {
margin-top: 35rpx;
}
.wrapper .item .list .payItem {
border: 1px solid #eee;
border-radius: 14rpx;
height: 86rpx;
width: 95%;
box-sizing: border-box;
margin-top: 20rpx;
font-size: 28rpx;
color: #282828;
}
.wrapper .item .list .payItem.on {
// border-color: #fc5445;
@include coupons_border_color(theme);
color: $theme-color;
}
.name {
width: 50%;
text-align: center;
border-right: 1px solid #eee;
}
.name .iconfont {
width: 44rpx;
height: 44rpx;
border-radius: 50%;
text-align: center;
line-height: 44rpx;
background-color: #fe960f;
color: #fff;
font-size: 30rpx;
margin-right: 15rpx;
}
.name .iconfont.icon-weixin2 {
background-color: #41b035;
}
.name .iconfont.icon-zhifubao {
background-color: #00AAEA;
}
.payItem .tip {
width: 49%;
text-align: center;
font-size: 26rpx;
color: #aaa;
}
</style>

View File

@@ -1,283 +0,0 @@
<template>
<view>
<view class="ChangePassword">
<view class="list">
<view class="item" v-if="isNew">
<input type='number' disabled='true' placeholder='填写手机号码1' placeholder-class='placeholder' v-model="userInfo.phone"></input>
</view>
<view class="item" v-if="!isNew">
<input type='number' placeholder='填写手机号码' placeholder-class='placeholder' v-model="phone"></input>
</view>
<view class="item acea-row row-between-wrapper">
<input type='number' placeholder='填写验证码' placeholder-class='placeholder' class="codeIput" v-model="captcha"></input>
<button class="code font-color" :class="disabled === true ? 'on' : ''" :disabled='disabled' @click="code">
{{ text }}
</button>
</view>
</view>
<button form-type="submit" v-if="isNew" class="confirmBnt bg-color" @click="next">下一步</button>
<button form-type="submit" v-if="!isNew" class="confirmBnt bg-color" @click="editPwd">保存</button>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
<script>
import sendVerifyCode from "@/mixins/SendVerifyCode";
import {
registerVerify,
bindingPhone,
verifyCode,
bindingVerify
} from '@/api/api.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
export default {
mixins: [sendVerifyCode],
components: {
// #ifdef MP
authorize
// #endif
},
data() {
return {
phone:'',
captcha:'',
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
key: '',
isNew: true,
timer: '',
text: '获取验证码',
nums: 60
};
},
mounted() {
// this.timer = setInterval(this.getTimes, 1000);
},
computed: mapGetters(['isLogin','userInfo']),
onLoad() {
if (this.isLogin) {
// verifyCode().then(res=>{
// this.$set(this, 'key', res.data.key)
// });
} else {
toLogin();
}
},
methods: {
getTimes(){
this.nums = this.nums - 1;
this.text = "剩余 " + this.nums + "s";
if (this.nums < 0) {
clearInterval(this.timer);
}
this.text = "剩余 " + this.nums + "s";
if (this.text < "剩余 " + 0 + "s") {
this.disabled = false;
this.text = "重新获取";
}
},
onLoadFun:function(){},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
next() {
uni.hideLoading();
this.isNew = false;
this.captcha = '';
clearInterval(this.timer);
this.disabled = false;
this.text = "获取验证码";
uni.showLoading({
title: '加载中',
mask: true
});
if (!this.captcha) return this.$util.Tips({
title: '请填写验证码'
});
bindingVerify({
phone: this.userInfo.phone,
captcha: this.captcha
}).then(res => {
uni.hideLoading();
this.isNew = false;
this.captcha = '';
clearInterval(this.timer);
this.disabled = false;
this.text = "获取验证码";
}).catch(err => {
return this.$util.Tips({
title: err
});
uni.hideLoading();
})
},
editPwd: function() {
let that = this;
if (!that.phone) return that.$util.Tips({
title: '请填写手机号码!'
});
if (!(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.phone))) return that.$util.Tips({
title: '请输入正确的手机号码!'
});
if (!that.captcha) return that.$util.Tips({
title: '请填写验证码'
});
uni.showModal({
title: '是否更换绑定账号',
confirmText: '绑定',
success(res) {
if (res.confirm) {
bindingPhone({
phone: that.phone,
captcha: that.captcha
}).then(res => {
return that.$util.Tips({
title: res.message,
icon: 'success'
}, {
tab: 5,
url: '/pages/users/user_info/index'
});
}).catch(err => {
return that.$util.Tips({
title: err
});
})
} else if (res.cancel) {
return that.$util.Tips({
title: '您已取消更换绑定!'
}, {
tab: 5,
url: '/pages/users/user_info/index'
});
}
}
});
},
/**
* 发送验证码
*
*/
async code() {
this.nums = 60;
uni.showLoading({
title: '加载中',
mask: true
});
let that = this;
if(!that.isNew){
if (!that.phone) return that.$util.Tips({
title: '请填写手机号码!'
});
if (!(/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.phone))) return that.$util.Tips({
title: '请输入正确的手机号码!'
});
}
await registerVerify(that.isNew?that.userInfo.phone:that.phone).then(res => {
that.$util.Tips({
title: res.message
});
that.timer = setInterval(that.getTimes, 1000);
that.disabled = true;
uni.hideLoading();
}).catch(err => {
return that.$util.Tips({
title: err
});
uni.hideLoading();
});
}
}
}
</script>
<style lang="scss" scoped>
.shading {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
/* #ifdef APP-VUE */
margin-top: 50rpx;
/* #endif */
/* #ifndef APP-VUE */
margin-top: 200rpx;
/* #endif */
image {
width: 180rpx;
height: 180rpx;
}
}
page {
background-color: #fff !important;
}
.ChangePassword .phone {
font-size: 32rpx;
font-weight: bold;
text-align: center;
margin-top: 55rpx;
}
.ChangePassword .list {
width: 580rpx;
margin: 53rpx auto 0 auto;
}
.ChangePassword .list .item {
width: 100%;
height: 110rpx;
border-bottom: 2rpx solid #f0f0f0;
}
.ChangePassword .list .item input {
width: 100%;
height: 100%;
font-size: 32rpx;
}
.ChangePassword .list .item .placeholder {
color: #b9b9bc;
}
.ChangePassword .list .item input.codeIput {
width: 340rpx;
}
.ChangePassword .list .item .code {
font-size: 32rpx;
// background-color: #fff;
}
.ChangePassword .list .item .code.on {
color: #b9b9bc !important;
}
.ChangePassword .confirmBnt {
font-size: 32rpx;
width: 580rpx;
height: 90rpx;
border-radius: 45rpx;
color: #fff;
margin: 92rpx auto 0 auto;
text-align: center;
line-height: 90rpx;
}
</style>

View File

@@ -1,225 +0,0 @@
<template>
<view>
<view class="ChangePassword">
<form @submit="editPwd" report-submit='true'>
<view class="phone">当前手机号{{phone}}</view>
<view class="list">
<view class="item">
<input type='password' placeholder='以字母开头长度在6~18之间只能包含字符、数字和下划线' placeholder-class='placeholder' name="password" :value="password"></input>
</view>
<view class="item">
<input type='password' placeholder='确认新密码' placeholder-class='placeholder' name="qr_password" :value="qr_password"></input>
</view>
<view class="item acea-row row-between-wrapper">
<input type='number' placeholder='填写验证码' placeholder-class='placeholder' class="codeIput" name="captcha" :value="captcha"></input>
<button class="code font-color" :class="disabled === true ? 'on' : ''" :disabled='disabled' @click="code">
{{ text }}
</button>
</view>
</view>
<button form-type="submit" class="confirmBnt bg-color">确认修改</button>
</form>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
<script>
import sendVerifyCode from "@/mixins/SendVerifyCode";
import {
phoneRegisterReset,
registerVerify
} from '@/api/api.js';
import {
getUserInfo
} from '@/api/user.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
export default {
mixins: [sendVerifyCode],
components: {
// #ifdef MP
authorize
// #endif
},
data() {
return {
userInfo: {},
phone: '',
password: '',
captcha: '',
qr_password: '',
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
};
},
computed: mapGetters(['isLogin']),
watch:{
isLogin:{
handler:function(newV,oldV){
if(newV){
this.getUserInfo();
}
},
deep:true
}
},
onLoad() {
if (this.isLogin) {
this.getUserInfo();
} else {
toLogin();
}
},
methods: {
/**
* 授权回调
*/
onLoadFun: function(e) {
this.getUserInfo();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
/**
* 获取个人用户信息
*/
getUserInfo: function() {
let that = this;
getUserInfo().then(res => {
let tel = res.data.phone;
let phone = tel.substr(0, 3) + "****" + tel.substr(7);
that.$set(that, 'userInfo', res.data);
that.phone = phone;
});
},
/**
* 发送验证码
*
*/
async code() {
let that = this;
if (!that.userInfo.phone) return that.$util.Tips({
title: '手机号码不存在,无法发送验证码!'
});
await registerVerify(that.userInfo.phone).then(res => {
that.$util.Tips({
title: res.message
});
that.sendCode();
}).catch(err => {
return that.$util.Tips({
title: err
});
});
},
/**
* H5登录 修改密码
*
*/
editPwd: function(e) {
let that = this,
password = e.detail.value.password,
qr_password = e.detail.value.qr_password,
captcha = e.detail.value.captcha;
if (!password) return that.$util.Tips({
title: '请输入新密码'
});
if (!/^[a-zA-Z]\w{5,17}$/i.test(password)) return that.$util.Tips({
title: '以字母开头长度在6~18之间只能包含字符、数字和下划线'
});
if (qr_password != password) return that.$util.Tips({
title: '两次输入的密码不一致!'
});
if (!captcha) return that.$util.Tips({
title: '请输入验证码'
});
phoneRegisterReset({
account: that.userInfo.phone,
captcha: captcha,
password: password
}).then(res => {
return that.$util.Tips({
title: res.message
}, {
tab: 3,
url: 1
});
}).catch(err => {
return that.$util.Tips({
title: err
});
});
}
}
}
</script>
<style lang="scss">
page {
background-color: #fff !important;
}
.ChangePassword .phone {
font-size: 32rpx;
font-weight: bold;
text-align: center;
margin-top: 55rpx;
}
.ChangePassword .list {
width: 580rpx;
margin: 53rpx auto 0 auto;
}
.ChangePassword .list .item {
width: 100%;
height: 110rpx;
border-bottom: 2rpx solid #f0f0f0;
}
.ChangePassword .list .item input {
width: 100%;
height: 100%;
font-size: 32rpx;
}
.ChangePassword .list .item .placeholder {
color: #b9b9bc;
}
.ChangePassword .list .item input.codeIput {
width: 340rpx;
}
.ChangePassword .list .item .code {
font-size: 32rpx;
background-color: #fff;
}
.ChangePassword .list .item .code.on {
color: #b9b9bc !important;
}
.ChangePassword .confirmBnt {
font-size: 32rpx;
width: 580rpx;
height: 90rpx;
border-radius: 45rpx;
color: #fff;
margin: 92rpx auto 0 auto;
text-align: center;
line-height: 90rpx;
}
</style>

View File

@@ -14,29 +14,23 @@
<view class='name line1'>{{items.storeName}}</view>
<view class='num'>x {{items.cartNum}}</view>
</view>
<view class='attr line1' v-if="items.suk">{{items.suk}}</view>
<view class='attr line1' v-else>{{items.storeName}}</view>
<view class='attr line1' v-if="items.sku">{{items.sku}}</view>
<view class='money'>{{items.price}}</view>
</view>
</view>
<view class='totalSum'>{{item.totalNum || 0}}件商品总金额 <text class='font-color price'>{{item.payPrice}}</text></view>
<view class='totalSum'>{{item.totalNum || 0}}件商品总金额 <text class=' price'>{{item.payPrice}}</text></view>
</view>
</view>
<view class='loadingicon acea-row row-center-wrapper' v-if="orderList.length">
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view>
<view v-if="orderList.length == 0">
<view v-if="orderList.length == 0 && !loading">
<emptyPage title="暂无订单~"></emptyPage>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
<script>
import home from '@/components/home';
import emptyPage from '@/components/emptyPage.vue'
import {
getOrderList
@@ -47,16 +41,9 @@
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
export default {
components: {
emptyPage,
home,
// #ifdef MP
authorize
// #endif
emptyPage
},
data() {
return {
@@ -66,9 +53,7 @@
orderList: [], //订单数组
orderStatus: -3, //订单状态
page: 1,
limit: 20,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
limit: 20
};
},
computed: mapGetters(['isLogin']),
@@ -96,13 +81,6 @@
this.getOrderList();
},
methods: {
onLoadFun() {
this.getOrderList();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
/**
* 去订单详情
*/
@@ -111,7 +89,7 @@
title: '缺少订单号无法查看订单详情'
});
uni.navigateTo({
url: '/pages/order_details/index?order_id=' + order_id + '&isReturen=1'
url: '/pages/order/order_details/index?order_id=' + order_id + '&isReturen=1'
})
},
@@ -135,7 +113,7 @@
that.$set(that,'orderList',that.orderList);
that.loadend = loadend;
that.loading = false;
that.loadTitle = loadend ? "我也是有底线的" : '加载更多';
that.loadTitle = loadend ? "我也是有底线的~" : '加载更多';
that.page = that.page + 1;
}).catch(err => {
that.loading = false;
@@ -176,6 +154,7 @@
.return-list .goodWrapper .totalSum .price {
font-size: 28rpx;
font-weight: bold;
@include price_color(theme);
}
.return-list .goodWrapper .iconfont {

View File

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
<template>
<view>
<view :data-theme="theme">
<view class='sign-record'>
<view class='list pad30' v-for="(item,index) in signList" :key="index">
<view class='item'>
@@ -10,7 +10,7 @@
<view class='name line1'>{{itemn.title}}</view>
<view>{{itemn.createDay}}</view>
</view>
<view class='num font-color'>+{{itemn.number}}</view>
<view class='num font_color'>+{{itemn.number}}</view>
</view>
</view>
</view>
@@ -19,9 +19,6 @@
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadtitle}}
</view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
@@ -29,15 +26,8 @@
import { getSignMonthList } from '@/api/user.js';
import { toLogin } from '@/libs/login.js';
import { mapGetters } from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
let app = getApp();
export default {
components: {
// #ifdef MP
authorize
// #endif
},
data() {
return {
loading:false,
@@ -46,8 +36,7 @@
page:1,
limit:8,
signList:[],
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
theme:app.globalData.theme,
};
},
computed: mapGetters(['isLogin']),
@@ -72,17 +61,6 @@
this.getSignMoneList();
},
methods: {
/**
*
* 授权回调
*/
onLoadFun:function(){
this.getSignMoneList();
},
// 授权关闭
authColse:function(e){
this.isShowAuth = e
},
/**
* 获取签到记录列表
*/
@@ -99,7 +77,7 @@
that.$set(that,'signList',that.signList);
that.loadend = loadend;
that.loading = false;
that.loadtitle = loadend ? "哼😕~我也是有底线的~" : "加载更多"
that.loadtitle = loadend ? "我也是有底线的~" : "加载更多"
}).catch(err=>{
that.loading = false;
that.loadtitle = '加载更多';
@@ -109,5 +87,8 @@
}
</script>
<style>
<style lang="scss">
.font_color{
@include main_color(theme);
}
</style>

View File

@@ -1,425 +0,0 @@
<template>
<view style="height: 100%;">
<view class='distribution-posters'>
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" :circular="circular" :interval="interval"
:duration="duration" @change="bindchange" previous-margin="40px" next-margin="40px">
<block v-for="(item,index) in spreadList" :key="index">
<swiper-item>
<image :src="item.pic" class="slide-image" :class="swiperIndex == index ? 'active' : 'quiet'"
mode='aspectFill' />
</swiper-item>
</block>
</swiper>
<!-- #ifdef MP -->
<view class='keep bg-color' @click='savePosterPath'>保存海报</view>
<!-- #endif -->
<!-- #ifndef MP -->
<div class="preserve acea-row row-center-wrapper">
<div class="line"></div>
<div class="tip">长按保存图片</div>
<div class="line"></div>
</div>
<!-- #endif -->
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<view class="canvas" v-if="canvasStatus">
<canvas style="width:750px;height:1190px;" canvas-id="canvasOne"></canvas>
<canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}" />
</view>
</view>
</template>
<script>
// #ifdef H5
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
// #endif
import {
getUserInfo,
spreadBanner
} from '@/api/user.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import {
base64src
} from '@/utils/base64src.js'
import authorize from '@/components/Authorize';
import {
getQrcode
} from '@/api/api.js';
// #endif
import home from '@/components/home';
import {
imageBase64
} from "@/api/public";
export default {
components: {
// #ifdef MP
authorize,
// #endif
home
},
data() {
return {
imgUrls: [],
indicatorDots: false,
circular: false,
autoplay: false,
interval: 3000,
duration: 500,
swiperIndex: 0,
spreadList: [],
poster: '',
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
qrcodeSize: 1000,
PromotionCode: '',
base64List: [],
canvasStatus: true //海报绘图标签
};
},
computed: mapGetters(['isLogin', 'uid', 'userInfo']),
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.userSpreadBannerList();
}
},
deep: true
}
},
onLoad() {
if (this.isLogin) {
this.userSpreadBannerList();
} else {
toLogin();
}
},
/**
* 用户点击右上角分享
*/
// #ifdef MP
onShareAppMessage: function() {
return {
title: this.userInfo.nickname + '-分销海报',
imageUrl: this.spreadList[0].pic,
path: '/pages/index/index?spid=' + this.uid,
};
},
// #endif
onReady() {},
methods: {
userSpreadBannerList: function() {
let that = this;
uni.showLoading({
title: '获取中',
mask: true,
})
spreadBanner({
page: 1,
limit: 5
}).then(res => {
uni.hideLoading();
that.$set(that, 'spreadList', res.data);
that.getImageBase64(res.data);
}).catch(err => {
uni.hideLoading();
});
},
getImageBase64: function(images) {
uni.showLoading({
title: '海报生成中',
mask: true
});
let that = this;
// #ifdef H5
let spreadList = []
// 生成一个Promise对象的数组
images.forEach(item => {
const oneApi = imageBase64({
url: item.pic
}).then(res => {
return res.data.code;
})
spreadList.push(oneApi)
})
Promise.all(spreadList).then(result => {
that.$set(that, 'base64List', result);
that.make();
that.setShareInfoStatus();
})
// #endif
// #ifdef MP
that.base64List = images.map(item => {
return item.pic
});
// #endif
// #ifdef MP
that.getQrcode();
// #endif
},
// 小程序二维码
getQrcode() {
let that = this;
let data = {
pid: that.uid,
path: 'pages/index/index'
}
let arrImagesUrl = "";
uni.downloadFile({
url: this.base64List[0],
success: (res) => {
arrImagesUrl = res.tempFilePath;
}
});
getQrcode(data).then(res => {
base64src(res.data.code, res => {
that.PromotionCode = res;
});
setTimeout(() => {
that.PosterCanvas(arrImagesUrl, that.PromotionCode, that.userInfo.nickname, 0);
}, 300);
}).catch(err => {
uni.hideLoading();
that.$util.Tips({
title: err
});
that.$set(that, 'canvasStatus', false);
});
},
// 生成二维码;
make() {
let that = this;
let href = '';
// #ifdef H5
href = window.location.href.split('/pages')[0];
// #endif
uQRCode.make({
canvasId: 'qrcode',
text: href + '/pages/index/index?spread=' + that.uid,
size: this.qrcodeSize,
margin: 10,
success: res => {
that.PromotionCode = res;
setTimeout(() => {
that.PosterCanvas(this.base64List[0], that.PromotionCode, that.userInfo
.nickname, 0);
}, 300);
},
complete: (res) => {},
fail: res => {
uni.hideLoading();
that.$util.Tips({
title: '海报二维码生成失败!'
});
}
})
},
PosterCanvas: function(arrImages, code, nickname, index) {
let context = uni.createCanvasContext('canvasOne')
context.clearRect(0, 0, 0, 0);
let that = this;
uni.getImageInfo({
src: arrImages,
success: function(res) {
context.drawImage(arrImages, 0, 0, 750, 1190);
context.save();
context.drawImage(code, 110, 925, 140, 140);
context.restore();
context.setFontSize(28);
context.fillText(nickname, 270, 980);
context.fillText('邀请您加入', 270, 1020);
setTimeout(() => {
context.draw(true, function() {
uni.canvasToTempFilePath({
destWidth: 750,
destHeight: 1190,
canvasId: 'canvasOne',
fileType: 'jpg',
success: function(res) {
// 在H5平台下tempFilePath 为 base64
uni.hideLoading();
that.spreadList[index].pic = res
.tempFilePath;
that.$set(that, 'poster', res
.tempFilePath);
that.$set(that, 'canvasStatus', false);
}
})
})
}, 100);
},
fail: function(err) {
uni.hideLoading();
that.$util.Tips({
title: '无法获取图片信息'
});
}
});
},
onLoadFun: function(e) {
this.$set(this, 'userInfo', e);
this.userSpreadBannerList();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
bindchange(e) {
let base64List = this.base64List;
let index = e.detail.current;
this.swiperIndex = index;
let arrImagesUrl = "";
uni.downloadFile({
url: base64List[index],
success: (res) => {
arrImagesUrl = res.tempFilePath;
setTimeout(() => {
this.$set(this, 'canvasStatus', true);
this.PosterCanvas(arrImagesUrl, this.PromotionCode, this.userInfo.nickname,
index);
}, 300);
}
});
},
// 点击保存海报
savePosterPath: function() {
let that = this;
uni.getSetting({
success(res) {
if (!res.authSetting['scope.writePhotosAlbum']) {
uni.authorize({
scope: 'scope.writePhotosAlbum',
success() {
uni.saveImageToPhotosAlbum({
filePath: that.poster,
success: function(res) {
that.$util.Tips({
title: '保存成功',
icon: 'success'
});
},
fail: function(res) {
that.$util.Tips({
title: '保存失败'
});
}
});
}
});
} else {
uni.saveImageToPhotosAlbum({
filePath: that.poster,
success: function(res) {
that.$util.Tips({
title: '保存成功',
icon: 'success'
});
},
fail: function(res) {
that.$util.Tips({
title: '保存失败'
});
}
});
}
}
});
},
setShareInfoStatus: function() {
if (this.$wechat.isWeixin()) {
let configAppMessage = {
desc: '分销海报',
title: this.userInfo.nickname + '-分销海报',
link: '/pages/index/index?spread=' + this.uid,
imgUrl: this.spreadList[0].pic
};
this.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"],
configAppMessage)
}
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #a3a3a3 !important;
height: 100% !important;
}
.canvas {
position: relative;
}
.distribution-posters {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.distribution-posters swiper {
width: 100%;
height: 1000rpx;
position: relative;
margin-top: 40rpx;
}
.distribution-posters .slide-image {
width: 100%;
height: 100%;
margin: 0 auto;
border-radius: 15rpx;
}
.distribution-posters .slide-image.active {
transform: none;
transition: all 0.2s ease-in 0s;
}
.distribution-posters .slide-image.quiet {
transform: scale(0.8333333);
transition: all 0.2s ease-in 0s;
}
.distribution-posters .keep {
font-size: 30rpx;
color: #fff;
width: 600rpx;
height: 80rpx;
border-radius: 50rpx;
text-align: center;
line-height: 80rpx;
margin: 38rpx auto;
}
.distribution-posters .preserve {
color: #fff;
text-align: center;
margin-top: 38rpx;
}
.distribution-posters .preserve .line {
width: 100rpx;
height: 1px;
background-color: #fff;
}
.distribution-posters .preserve .tip {
margin: 0 30rpx;
}
</style>

View File

@@ -1,242 +0,0 @@
<template>
<view>
<view class='commission-details'>
<view class='promoterHeader bg-color'>
<view class='headerCon acea-row row-between-wrapper'>
<view>
<view class='name'>{{name}}</view>
<view class='money' v-if="recordType == 4"><text class='num'>{{extractCount}}</text></view>
<view class='money' v-else><text class='num'>{{commissionCount}}</text></view>
</view>
<view class='iconfont icon-jinbi1'></view>
</view>
</view>
<view class='sign-record' v-if="recordType == 4">
<block v-for="(item,index) in recordList" :key="index" v-if="recordList.length>0">
<view class='list pad30'>
<view class='item'>
<view class='data'>{{item.date}}</view>
<view class='listn borRadius14'>
<block v-for="(child,indexn) in item.list" :key="indexn">
<view class='itemn acea-row row-between-wrapper'>
<view>
<view class='name line1'>{{child.status | statusFilter}}</view>
<view>{{child.createTime}}</view>
</view>
<view class='num font-color' v-if="child.status == 1">+{{child.extractPrice}}
</view>
<view class='num' v-else>-{{child.extractPrice}}</view>
<!-- <view>
<view class='name line1'>{{child.status === -1 ? '提现失败' : '提现成功'}}<span
v-show="child.status === -1"
style="font-size: 12px;color: red;">{{'('+child.failMsg+')'}}</span>
</view>
<view>{{child.createTime}}</view>
</view>
<view class='num font-color' v-if="child.status == -1">+{{child.extractPrice}}
</view>
<view class='num' v-else>-{{child.extractPrice}}</view> -->
</view>
</block>
</view>
</view>
</view>
</block>
<view v-if="recordList.length == 0">
<emptyPage title='暂无提现记录~'></emptyPage>
</view>
</view>
<view class='sign-record' v-else>
<block v-for="(item,index) in recordList" :key="index" v-if="recordList.length>0">
<view class='list pad30'>
<view class='item'>
<view class='data'>{{item.date}}</view>
<view class='listn borRadius14'>
<block v-for="(child,indexn) in item.list" :key="indexn">
<view class='itemn acea-row row-between-wrapper'>
<view>
<view class='name line1'>{{child.title}}</view>
<view>{{child.updateTime}}</view>
</view>
<view class='num font-color' v-if="child.type == 1">+{{child.price}}
</view>
<view class='num' v-else>-{{child.price}}</view>
</view>
</block>
</view>
</view>
</view>
</block>
<view v-if="recordList.length == 0">
<emptyPage title='暂无佣金记录~'></emptyPage>
</view>
</view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
<script>
import {
getCommissionInfo,
getRecordApi,
} from '@/api/user.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import emptyPage from '@/components/emptyPage.vue'
import home from '@/components/home';
export default {
components: {
// #ifdef MP
authorize,
// #endif
emptyPage,
home
},
filters: {
statusFilter(status) {
const statusMap = {
'-1': '未通过',
'0': '审核中',
'1': '已提现'
}
return statusMap[status]
}
},
data() {
return {
name: '',
type: 0,
page: 1,
limit: 10,
recordList: [],
recordType: 0,
statuss: false,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
extractCount: 0
};
},
computed: mapGetters(['isLogin']),
onLoad(options) {
if (this.isLogin) {
this.type = options.type;
this.extractCount = options.extractCount;
this.commissionCount = options.commissionCount;
} else {
toLogin();
}
},
onShow: function() {
let type = this.type;
if (type == 1) {
uni.setNavigationBarTitle({
title: "提现记录"
});
this.name = '提现总额';
this.recordType = 4;
this.getList();
} else if (type == 2) {
uni.setNavigationBarTitle({
title: "佣金记录"
});
this.name = '佣金明细';
this.recordType = 3;
this.getRecordList();
} else {
uni.showToast({
title: '参数错误',
icon: 'none',
duration: 1000,
mask: true,
success: function(res) {
setTimeout(function() {
// #ifndef H5
uni.navigateBack({
delta: 1,
});
// #endif
// #ifdef H5
history.back();
// #endif
}, 1200)
},
});
}
},
methods: {
onLoadFun() {
this.getRecordList();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
getList: function() {
let that = this;
let recordList = that.recordList;
let recordListNew = [];
if (that.statuss == true) return;
getRecordApi({
page: that.page,
limit: that.limit
}).then(res => {
let len = res.data.list ? res.data.list.length : 0;
let recordListData = res.data.list || [];
recordListNew = recordList.concat(recordListData);
that.statuss = that.limit > len;
that.page = that.page + 1;
that.$set(that, 'recordList', recordListNew);
});
},
getRecordList: function() {
let that = this;
let page = that.page;
let limit = that.limit;
let statuss = that.statuss;
let recordType = that.recordType;
let recordList = that.recordList;
let recordListNew = [];
if (statuss == true) return;
getCommissionInfo({
page: page,
limit: limit
}).then(res => {
if (res.data.list) {
let len = res.data.list ? res.data.list.length : 0;
let recordListData = res.data.list || [];
recordListNew = recordList.concat(recordListData);
that.statuss = limit > len;
that.page = page + 1;
that.$set(that, 'recordList', recordListNew);
}
});
}
},
onReachBottom: function() {
this.getRecordList();
}
}
</script>
<style scoped lang="scss">
.commission-details .promoterHeader .headerCon .money {
font-size: 36rpx;
}
.commission-details .promoterHeader .headerCon .money .num {
font-family: 'Guildford Pro';
}
</style>

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

@@ -22,6 +22,9 @@
},
onLoad(option) {
if(option.webUel) this.url = option.webUel;
// 蚂蚁智能客服场景参数
if(option.tntInstId) this.url += `?tntInstId=${option.tntInstId}`;
if(option.scene) this.url += `&scene=${option.scene}`;
uni.setNavigationBarTitle({
title: option.title
})

View File

@@ -1,38 +1,45 @@
<template>
<view class="page">
<view class="page" :data-theme="theme" :style="{'background-image': `url(${backBg})`}">
<view class="system-height" :style="{height:statusBarHeight}"></view>
<!-- #ifdef MP -->
<view class="title-bar" style="height: 43px;">
<view class="icon" @click="back" v-if="!isHome">
<image src="../static/left.png"></image>
<image :src="urlDomain+'crmebimage/perset/usersImg/left.png'"></image>
</view>
<view class="icon" @click="home" v-else>
<image src="../static/home.png"></image>
<image :src="urlDomain+'crmebimage/perset/usersImg/home.png'"></image>
</view>
账户登录
</view>
<!-- #endif -->
<view class="wechat_login">
<view class="img">
<image src="../static/wechat_login.png" mode="widthFix"></image>
<view class="img acea-row row-center">
<image :src="mobileLoginLogo" mode="widthFix" class="image"></image>
</view>
<view class="company">{{companyName}}</view>
<view class="btn-wrapper">
<!-- #ifdef H5 -->
<button hover-class="none" @click="wechatLogin" class="bg-green btn1">微信登录</button>
<button hover-class="none" @click="wechatLogin" class="btn1 bg-color"><text
class='iconfont icon-weixin2'></text>立即登录</button>
<!-- #endif -->
<!-- #ifdef MP -->
<button hover-class="none" @tap="getUserProfile" class="bg-green btn1">微信登录</button>
<button v-if="wxLogin" hover-class="none"
@click="getUserProfile" class="btn1 bg-color">立即登录</button>
<view v-else>
<button v-if="routinePhoneVerification == 1 || routinePhoneVerification.length===3" hover-class="none"
@click="onUserPhone" class="btn1 bg-color"><text
class='iconfont'></text>一键绑定手机号</button>
<button v-if="routinePhoneVerification == 2 || routinePhoneVerification.length===3" hover-class="none"
@click="onUserPhone('isPhone')" class="btn2">手动绑定手机号</button>
</view>
<!-- #endif -->
<!-- <button hover-class="none" @click="isUp = true" class="btn2">手机号登录</button> -->
</view>
</view>
<block v-if="isUp">
<mobileLogin :isUp="isUp" @close="maskClose" :authKey="authKey" @wechatPhone="wechatPhone"></mobileLogin>
</block>
<block v-if="isPhoneBox">
<routinePhone :logoUrl="logoUrl" :isPhoneBox="isPhoneBox" @close="bindPhoneClose" :authKey="authKey">
</routinePhone>
<mobileLogin :isUp="isUp" :loginConfig="loginConfig" @close="maskClose" :authKey="authKey" @wechatPhone="wechatPhone"></mobileLogin>
</block>
<atModel v-if="isPhoneBox" :userPhoneType="true" :isPhoneBox="isPhoneBox" :authKey="authKey"
:content="getPhoneContent" @closeModel="bindPhoneClose" @confirmModel="confirmModel"></atModel>
</view>
</template>
@@ -40,12 +47,11 @@
const app = getApp();
let statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
import mobileLogin from '@/components/login_mobile/index.vue'
import routinePhone from '@/components/login_mobile/routine_phone.vue'
import atModel from '@/components/accredit/index.vue'
import {
mapGetters
} from "vuex";
import {
getLogo,
getUserPhone
} from '@/api/public';
import {
@@ -55,34 +61,65 @@
STATE_R_KEY
} from '@/config/cache';
import {
getUserInfo
HTTP_REQUEST_URL
} from '@/config/app';
import {
getUserInfo,
spread
} from '@/api/user.js'
import Routine from '@/libs/routine';
import wechat from "@/libs/wechat";
export default {
data() {
return {
isUp: false,
urlDomain: this.$Cache.get("imgHost"),
isUp: false, // 绑定手机号手动输入弹窗
phone: '',
statusBarHeight: statusBarHeight,
isHome: false,
isPhoneBox: false,
logoUrl: '',
isPhoneBox: false, //授权手机号弹窗
code: '',
authKey: '',
options: '',
userInfo: {},
codeNum: 0
codeNum: 0,
pageStyle: {}, //背景图
theme: app.globalData.theme,
// urlDomain: this.$GLOBAL.urlDomain,
backBg: '', //背景图片
getPhoneContent: '申请获取您的手机号用于注册,完成后可使用商城更多功能',
wxCode: '', //小程序code值
companyName: app.globalData.companyName, //公司名称
routinePhoneVerification: app.globalData.routinePhoneVerification, //小程序手机号校验类型多选1微信小程序验证 2短信验证
loginConfig: '' ,//小程序绑定手机号isPhone其他手机号绑定
wxLogin: true ,//登录显示
mobileLoginLogo: app.globalData.mobileLoginLogo // 登录页logo
}
},
components: {
mobileLogin,
routinePhone
atModel
},
onLoad(options) {
getLogo().then(res => {
this.logoUrl = res.data.logoUrl
})
//背景图片
switch (app.globalData.theme) {
case 'theme1':
this.backBg = `${this.urlDomain}crmebimage/perset/usersImg/wxbj1.png`;
break;
case 'theme2':
this.backBg = `${this.urlDomain}crmebimage/perset/usersImg/wxbj2.png`;
break;
case 'theme3':
this.backBg = `${this.urlDomain}crmebimage/perset/usersImg/wxbj3.png`;
break;
case 'theme4':
this.backBg = `${this.urlDomain}crmebimage/perset/usersImg/wxbj4.png`;
break;
case 'theme5':
this.backBg = `${this.urlDomain}crmebimage/perset/usersImg/wxbj5.png`;
break;
}
let that = this
// #ifdef H5
document.body.addEventListener("focusout", () => {
@@ -102,7 +139,7 @@
this.code = code || ''
//if(!code) location.replace(decodeURIComponent(decodeURIComponent(option.query.back_url)));
if (code && this.options.scope !== 'snsapi_base') {
let spread = app.globalData.spid ? app.globalData.spid : 0;
let spread = app.globalData.spread ? app.globalData.spread : 0;
//公众号授权登录回调 wechatAuth(code, Cache.get("spread"), loginType)
wechat.auth(code, spread).then(res => {
if (res.type === 'register') {
@@ -115,7 +152,7 @@
});
this.$store.commit("SETUID", res.uid);
this.getUserInfo();
this.wechatPhone();
//this.wechatPhone();
//location.replace(decodeURIComponent(decodeURIComponent(option.query.back_url)));
}
}).catch(error => {});
@@ -131,6 +168,12 @@
},
methods: {
//绑定手机号弹窗回调
confirmModel() {
this.isPhoneBox = false;
this.isUp = true
},
back() {
uni.navigateBack();
},
@@ -139,9 +182,12 @@
url: '/pages/index/index'
})
},
modelCancel() {
this.isPhoneBox = false;
},
// 弹窗关闭
maskClose() {
this.isUp = false
// this.isUp = false //点击模态框会关闭登录弹框,防止用户误触而关闭
},
bindPhoneClose(data) {
if (data.isStatus) {
@@ -158,50 +204,6 @@
},
// #ifdef MP
// 小程序获取手机号码
getphonenumber(e) {
uni.showLoading({
title: '正在登录中'
});
Routine.getCode()
.then(code => {
this.getUserPhoneNumber(e.detail.encryptedData, e.detail.iv, code);
})
.catch(error => {
uni.$emit('closePage', false)
uni.hideLoading();
});
},
// 小程序获取手机号码回调
getUserPhoneNumber(encryptedData, iv, code) {
getUserPhone({
encryptedData: encryptedData,
iv: iv,
code: code,
type: 'routine',
key: this.authKey
})
.then(res => {
this.$store.commit('LOGIN', {
token: res.data.token
});
this.$store.commit("SETUID", res.data.uid);
this.getUserInfo();
this.$util.Tips({
title: '登录成功',
icon: 'success'
}, {
tab: 3
})
})
.catch(res => {
uni.hideLoading();
that.$util.Tips({
title: res
});
});
},
/**
* 获取个人用户信息
*/
@@ -219,45 +221,74 @@
})
});
},
//绑定手机号
onUserPhone(type) {
this.loginConfig = type;
//如果是其他手机号绑定,调整页面。否则授权本机手机号登录
if (this.loginConfig === 'isPhone') {
uni.navigateTo({
url: `/pages/users/app_login/index?code=${this.wxCode}&authKey=${this.authKey}`
})
} else {
this.isPhoneBox = true
}
},
//wx小程序立即登录
getUserProfile() {
let self = this;
uni.showLoading({
title: '正在登录中'
});
Routine.getUserProfile()
.then(res => {
Routine.getCode()
.then(code => {
self.getWxUser(code, res);
})
.catch(res => {
uni.hideLoading();
});
})
.catch(res => {
uni.hideLoading();
});
const hostSDKVersion = uni.getSystemInfoSync().hostSDKVersion; //小程序基础库版本号
if (Routine.compareVersion(hostSDKVersion, '2.21.2') >= 0) {
Routine.getCode()
.then(code => {
let userInfo = {};
userInfo.code = code;
userInfo.spread_spid = app.globalData.spread; //获取推广人ID
userInfo.avatar = '';
userInfo.nickName = '微信用户';
userInfo.type = 'routine'
self.getWxUser(code, userInfo);
})
.catch(res => {
uni.hideLoading();
});
} else {
Routine.getUserProfile().then(res => {
Routine.getCode()
.then(code => {
let userInfo = res.userInfo;
userInfo.code = code;
userInfo.spread_spid = app.globalData.spread; //获取推广人ID
userInfo.avatar = userInfo.userInfo.avatarUrl;
userInfo.city = userInfo.userInfo.city;
userInfo.country = userInfo.userInfo.country;
userInfo.nickName = userInfo.userInfo.nickName;
userInfo.province = userInfo.userInfo.province;
userInfo.sex = userInfo.userInfo.gender;
userInfo.type = 'routine'
self.getWxUser(code, userInfo);
})
.catch(res => {
uni.hideLoading();
});
})
.catch(res => {
uni.hideLoading();
});
}
},
getWxUser(code, res) {
let self = this
let userInfo = res.userInfo;
userInfo.code = code;
userInfo.spread_spid = app.globalData.spid; //获取推广人ID
userInfo.spread_code = app.globalData.code; //获取推广人分享二维码ID
userInfo.avatar = userInfo.userInfo.avatarUrl;
userInfo.city = userInfo.userInfo.city;
userInfo.country = userInfo.userInfo.country;
userInfo.nickName = userInfo.userInfo.nickName;
userInfo.province = userInfo.userInfo.province;
userInfo.sex = userInfo.userInfo.gender;
userInfo.type = 'routine'
// 登录调用方法
getWxUser(code, userInfo) {
this.wxCode = code;
let self = this;
Routine.authUserInfo(userInfo.code, userInfo)
.then(res => {
self.authKey = res.data.key;
if (res.data.type === 'register') {
uni.hideLoading();
self.isPhoneBox = true
self.wxLogin = false;
}
if (res.data.type === 'login') {
uni.hideLoading();
@@ -266,6 +297,9 @@
});
self.$store.commit("SETUID", res.data.uid);
self.getUserInfo();
if (app.globalData.spread) {
spread(app.globalData.spread).then(res => {}) //登录成功后读取spread绑定分销关系
}
self.$util.Tips({
title: res,
icon: 'success'
@@ -282,10 +316,7 @@
duration: 2000
});
});
},
// #endif
// #ifdef H5
// 获取url后面的参数
@@ -341,23 +372,37 @@
}
}
</script>
<style lang="scss">
page {
background: #fff;
height: 100%;
}
</style>
<style lang="scss" scoped>
.icon-weixin2{
margin-right: 10rpx;
}
.company {
font-size: 40rpx;
color: #333;
text-align: center;
font-weight: 500;
margin: 32rpx 0 96rpx 0;
}
.page {
background: #fff;
height: 100%;
background-size: contain;
background-repeat: no-repeat;
}
.wechat_login {
padding: 72rpx 34rpx;
padding-top: 238rpx;
.img image {
width: 100%;
.img .image {
width: 152rpx;
height: 152rpx;
}
.btn-wrapper {
@@ -367,10 +412,10 @@
button {
width: 100%;
height: 86rpx;
line-height: 86rpx;
margin-bottom: 40rpx;
line-height: 84rpx;
margin-bottom: 32rpx;
border-radius: 120rpx;
font-size: 30rpx;
font-size: 32rpx;
&.btn1 {
color: #fff;
@@ -378,7 +423,7 @@
&.btn2 {
color: #666666;
border: 1px solid #666666;
border: 2px solid #E4E4E4;
}
}
}
@@ -407,4 +452,4 @@
height: 50rpx;
}
}
</style>
</style>