全新UI视觉体验,移动端API优化降低重复调用,提高并发6倍,修复N多Bug

This commit is contained in:
stivepeim
2021-06-11 17:41:16 +08:00
parent 0b9f28fa52
commit b76840e10f
582 changed files with 35633 additions and 28276 deletions

View File

@@ -0,0 +1,266 @@
<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>
</template>
<script>
const app = getApp();
import sendVerifyCode from "@/mixins/SendVerifyCode";
import Routine from '@/libs/routine';
import {
loginMobile,
registerVerify,
getCodeApi,
getUserInfo,
phoneSilenceAuth,
phoneWxSilenceAuth
} from "@/api/user";
import {
bindingPhone
} from '@/api/api.js'
import {
getUserPhone
} from '@/api/public';
import mobileLogin from '@/components/login_mobile/index.vue'
export default {
name: 'login_mobile',
data() {
return {
options: '',
keyCode: '',
account: '',
codeNum: '',
isUp: true,
authKey: '',
logoUrl: '',
isShow: false,
isPos: false,
platform: '', // 手机平台
appleShow: '' //是否是苹果登录
}
},
components: {
mobileLogin
},
mixins: [sendVerifyCode],
mounted() {
//this.getCode();
},
onLoad: function(options) {
let that = this;
// 获取系统信息
uni.getSystemInfo({
success(res) {
that.platform = res.platform;
}
});
const {
code,
state,
scope,
back_url,
appleShow
} = options;
that.options = options
if (options.authKey) that.authKey = options.authKey
if (options.appleShow) that.appleShow = options.appleShow
},
methods: {
wechatPhone() {
this.$Cache.clear('snsapiKey');
if (this.options.back_url) {
let url = uni.getStorageSync('snRouter');
url = url.indexOf('/pages/index/index') != -1 ? '/' : url;
if (url.indexOf('/pages/users/wechat_login/index') !== -1) {
url = '/';
}
if (!url) {
url = '/pages/index/index';
}
this.isUp = false
uni.showToast({
title: '登录成功',
icon: 'none'
})
setTimeout(res => {
location.href = url
}, 800)
} else {
uni.navigateBack()
}
},
// 获取验证码
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: '请输入正确的手机号码'
});
await registerVerify(that.account).then(res => {
that.$util.Tips({
title: res.msg
});
that.sendCode();
}).catch(err => {
return that.$util.Tips({
title: err
})
})
},
// 获取验证码api
getCode() {
let that = this
getCodeApi().then(res => {
that.keyCode = res.data.key;
}).catch(res => {
that.$util.Tips({
title: res
});
});
},
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
/**
* 获取个人用户信息
*/
getUserInfo: function() {
let that = this;
getUserInfo().then(res => {
uni.hideLoading();
that.userInfo = res.data
that.$store.commit("UPDATE_USERINFO", res.data);
// #ifdef MP
that.$util.Tips({
title: '登录成功',
icon: 'success'
}, {
tab: 3
})
that.close()
// #endif
// #ifdef H5
that.$emit('wechatPhone', true)
// #endif
});
},
}
}
</script>
<style>
page {
height: 100%;
}
</style>
<style lang="scss" scoped>
.appBox {
background-color: #fff;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
overflow: hidden;
}
.shading {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
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

@@ -29,11 +29,15 @@
<view class="people font-color">{{item.brokeragePrice}}</view>
</view>
</view>
<view class='noCommodity' v-if="rankList.length == 0 && (page != 1 || active== 0)">
<emptyPage title="暂无排行~"></emptyPage>
</view>
</view>
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
@@ -45,6 +49,8 @@
import {
toLogin
} from '@/libs/login.js';
import home from '@/components/home';
import emptyPage from '@/components/emptyPage.vue'
import {
mapGetters
} from "vuex";
@@ -53,6 +59,8 @@
// #endif
export default {
components: {
emptyPage,
home,
// #ifdef MP
authorize
// #endif
@@ -90,13 +98,7 @@
this.getBrokerageRankList();
this.getBrokerageRankNumber(this.type);
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
methods: {
@@ -179,7 +181,7 @@
.CommissionRank .wrapper {
width: 710rpx;
background-color: #fff;
border-radius: 20rpx;
border-radius: 14rpx;
margin: -76rpx auto 0 auto;
}
@@ -193,7 +195,8 @@
}
.CommissionRank .wrapper .nav .item.font-color {
border-bottom: 4rpx solid #e93323;
border-bottom: 4rpx solid $theme-color;
margin-top: -2rpx;
}
.CommissionRank .wrapper .list {

View File

@@ -1,24 +1,27 @@
<template>
<view>
<form @submit="formSubmit" report-submit='true'>
<view class='evaluate-con'>
<view class='goodsStyle acea-row row-between'>
<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 class='name line2'>{{productInfo.storeName}}</view>
<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.price}}</view>
<view class='num'>x{{cart_num}}</view>
<view>{{productInfo.truePrice}}</view>
<view class='num'>x{{productInfo.cartNum}}</view>
</view>
</view>
</view>
<view class='score'>
<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 font-color':'icon-kongxinxing'"></text>
<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>
@@ -27,7 +30,7 @@
<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 font-color' @click='DelPic(index)'></text>
<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>
@@ -40,7 +43,7 @@
</view>
</form>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
@@ -103,26 +106,19 @@
}
},
onLoad(options) {
if (!options.unique || !options.uni || !options.id) return this.$util.Tips({
if (!options.unique || !options.orderId ) return this.$util.Tips({
title: '缺少参数'
}, {
tab: 3,
url: 1
});
this.unique = options.unique;
this.orderId = options.uni;
this.id = options.id;
this.evaluateId = options.id;
this.unique = Number(options.unique) || 0;
this.orderId = options.orderId || 0;
this.evaluateId = Number(options.id) || 0;
if (this.isLogin) {
this.getOrderProduct();
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
methods: {
@@ -140,12 +136,12 @@
getOrderProduct: function() {
let that = this;
orderProduct({
orderId: that.id,
orderId: that.evaluateId,
uni: that.unique
}).then(res => {
that.$set(that, 'productInfo', res.data.productInfo);
that.$set(that, 'cart_num', res.data.cartNum);
that.$set(that, 'productId', res.data.productId);
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) {
@@ -159,7 +155,7 @@
let that = this,
pic = this.picsPath[index];
that.picsPath.splice(index, 1);
that.$set(that, 'picsPath', that.picsPath);
that.pics.splice(index, 1);
},
/**
@@ -196,10 +192,10 @@
value.productScore = product_score;
value.serviceScore = service_score;
value.pics = that.pics.length>0?JSON.stringify(that.pics):'';
value.productId = that.productId;
value.oid = that.evaluateId;
value.productId = that.productInfo.productId;
value.orderNo = that.orderId;
value.unique = that.unique;
value.sku = that.productInfo.attrInfo.suk;
value.sku = that.productInfo.sku;
uni.showLoading({
title: "正在发布评论……"
});
@@ -221,16 +217,23 @@
</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;
// border-top: 1rpx solid #f5f5f5;
margin-top: 20rpx;
font-size: 28rpx;
color: #282828;
padding: 48rpx 30rpx 65rpx 30rpx;
padding: 46rpx 24rpx;
}
.evaluate-con .score .item~.item {
margin-top: 30rpx;
margin-top: 36rpx;
}
.evaluate-con .score .item .starsList {
@@ -252,10 +255,10 @@
}
.evaluate-con .score .textarea {
width: 690rpx;
background-color: #fafafa;
border-radius: 10rpx;
margin-top: 48rpx;
width: 100%;
background-color: #F5F5F5;
border-radius: 14rpx;
margin-top: 55rpx;
}
.evaluate-con .score .textarea textarea {
@@ -264,6 +267,7 @@
width: 100%;
box-sizing: border-box;
height: 160rpx;
width: auto !important;
}
.evaluate-con .score .textarea .placeholder {
@@ -282,6 +286,7 @@
position: relative;
font-size: 22rpx;
color: #bbb;
border-radius: 14rpx;
}
.evaluate-con .score .textarea .list .pictrue:nth-last-child(1) {
@@ -292,7 +297,7 @@
.evaluate-con .score .textarea .list .pictrue image {
width: 100%;
height: 100%;
border-radius: 3rpx;
border-radius: 14rpx;
}
.evaluate-con .score .textarea .list .pictrue .icon-guanbi1 {
@@ -310,7 +315,7 @@
.evaluate-con .score .evaluateBnt {
font-size: 30rpx;
color: #fff;
width: 690rpx;
width: 100%;
height: 86rpx;
border-radius: 43rpx;
text-align: center;

View File

@@ -1,23 +1,29 @@
<template>
<view>
<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 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 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 class='loadingicon acea-row row-center-wrapper'>
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view>
</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'>
@@ -75,7 +81,7 @@
getProductReplyCount: function() {
let that = this;
getReplyConfig(that.productId).then(res => {
that.$set(that,'replyData',res.data);
that.$set(that, 'replyData', res.data);
});
},
/**
@@ -95,16 +101,16 @@
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.$set(that, 'reply', that.reply);
that.loading = false;
that.loadend = loadend;
if(that.reply.length){
if (that.reply.length) {
that.loadTitle = loadend ? "😕人家是有底线的~~" : "加载更多";
}
that.page = that.page + 1;
}).catch(err => {
that.loading = false,
that.loadTitle = '加载更多'
that.loadTitle = '加载更多'
});
},
/*
@@ -116,7 +122,7 @@
this.type = type;
this.page = 1;
this.loadend = false;
this.$set(this,'reply',[]);
this.$set(this, 'reply', []);
this.getProductReplyList();
}
},
@@ -130,10 +136,48 @@
</script>
<style lang="scss">
page{background-color:#fff;}
.evaluate-list .generalComment{height:94rpx;padding:0 30rpx;margin-top:1rpx;background-color:#fff;font-size:28rpx;color:#808080;}
.evaluate-list .generalComment .evaluate{margin-right:7rpx;}
.evaluate-list .nav{font-size:24rpx;color:#282828;padding:0 30rpx 32rpx 30rpx;background-color:#fff;border-bottom:1rpx solid #f5f5f5;}
.evaluate-list .nav .item{font-size:24rpx;color:#282828;border-radius:6rpx;height:54rpx;padding:0 20rpx;background-color:#f4f4f4;line-height:54rpx;margin-right:17rpx;}
.evaluate-list .nav .item.bg-color{color:#fff;}
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

@@ -12,32 +12,36 @@
<div class="row-right">
<div>
<!-- #ifdef H5 -->
<a class="store-phone" :href="'tel:' + item.phone"><span class="iconfont icon-dadianhua01"></span></a>
<a class="store-phone" :href="'tel:' + item.phone"><span
class="iconfont icon-dadianhua01"></span></a>
<!-- #endif -->
<!-- #ifdef MP || APP-PLUS -->
<view class="store-phone" @click="call(item.phone)"><text class="iconfont icon-dadianhua01"></text></view>
<!-- #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.range">距离{{ item.range }}千米</span>
<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;"
<!-- <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>
</iframe> -->
</div>
</div>
</template>
@@ -111,29 +115,60 @@
},
selfLocation() {
let self = this
uni.getLocation({
type: 'wgs84',
success: function(res) {
try {
uni.setStorageSync('user_latitude', res.latitude);
uni.setStorageSync('user_longitude', res.longitude);
} catch {}
// #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();
},
complete:function() {
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) {
uni.openLocation({
latitude: Number(e.latitude),
longitude: Number(e.longitude),
success: function() {
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');
Number
}
});
})
} 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) {
@@ -241,9 +276,10 @@
border-radius: 50%;
display: block;
text-align: center;
line-height: 50rpx;
line-height: 48rpx;
background-color: #e83323;
margin-bottom: 22rpx;
text-decoration: none;
}
.store-distance {

View File

@@ -3,13 +3,13 @@
<view class='logistics'>
<view class='header acea-row row-between row-top'>
<view class='pictrue'>
<image :src='product.productInfo.image'></image>
<image :src='product.productImg'></image>
</view>
<view class='text acea-row row-between'>
<view class='name line2'>{{product.productInfo.storeName}}</view>
<view class='name line2'>{{product.productName}}</view>
<view class='money'>
<view>{{product.truePrice}}</view>
<view>x{{product.cartNum}}</view>
<view>{{product.price}}</view>
<view>x{{product.payNum}}</view>
</view>
</view>
</view>
@@ -40,7 +40,7 @@
<recommend :hostProduct='hostProduct' v-if="hostProduct.length"></recommend>
</view>
<!-- #ifdef MP -->
<authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
@@ -106,13 +106,7 @@
this.getExpress();
this.get_host_product();
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
onReady: function() {
@@ -142,30 +136,11 @@
let that=this;
express(that.orderId).then(function(res){
let result = res.data.express|| {};
that.$set(that,'product',res.data.order.cartInfo[0] || {});
that.$set(that,'product',res.data.order.info[0] || {});
that.$set(that,'orderInfo',res.data.order);
that.$set(that,'expressList',result.list || []);
});
},
/**
* 获取我的推荐
*/
// getGroomList(onloadH) {
// this.loading = true
// if (!this.goodScroll) return
// if (onloadH) {
// this.iSshowH = true
// }
// getGroomList(type, this.params).then(({
// data
// }) => {
// this.iSshowH = false
// this.loading = false
// this.goodScroll = data.list.length >= this.params.limit
// this.params.page++
// this.tempArr = this.tempArr.concat(data.list)
// })
// }
get_host_product: function () {
this.loading = true
if (!this.goodScroll) return
@@ -176,7 +151,6 @@
that.goodScroll = res.data.list.length >= that.params.limit
that.params.page++
that.hostProduct = that.hostProduct.concat(res.data.list)
// that.$set(that,'hostProduct',res.data.list);
});
},
},
@@ -271,7 +245,7 @@
height: 40rpx;
text-align: center;
line-height: 40rpx;
border-radius: 3rpx;
border-radius: 20rpx;
border: 1rpx solid #999;
}
@@ -291,15 +265,15 @@
}
.logistics .logisticsCon .item .circular.on {
background-color: #e93323;
background-color: $theme-color;
}
.logistics .logisticsCon .item .text.on-font {
color: #e93323;
color: $theme-color;
}
.logistics .logisticsCon .item .text .data.on-font {
color: #e93323;
color: $theme-color;
}
.logistics .logisticsCon .item .text {

View File

@@ -2,21 +2,17 @@
<view>
<form @submit="subRefund" report-submit='true'>
<view class='apply-return'>
<view class='goodsStyle acea-row row-between' v-for="(item,index) in orderInfo.cartInfo" :key="index">
<view class='pictrue'><image :src='item.info.productInfo.image'></image></view>
<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.info.productInfo.storeName}}</view>
<view class='money' v-if="item.info.productInfo.attrInfo">
<view>{{item.info.productInfo.attrInfo.price}}</view>
<view class='num'>x{{item.info.cartNum}}</view>
</view>
<view class='money' v-else>
<view>{{item.info.productInfo.price}}</view>
<view class='num'>x{{item.info.cartNum}}</view>
<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'>
<view class='list borRadius14'>
<view class='item acea-row row-between-wrapper'>
<view>退货件数</view>
<view class='num'>{{orderInfo.totalNum}}</view>
@@ -38,7 +34,7 @@
<view>备注说明</view>
<textarea placeholder='填写备注信息100字以内' class='num' name="refund_reason_wap_explain" placeholder-class='填写备注信息100字以内'></textarea>
</view>
<view class='item acea-row row-between'>
<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>
@@ -54,17 +50,17 @@
</view>
</view>
</view>
<button class='returnBnt bg-color' form-type="submit">申请退款</button>
</view>
<button class='returnBnt bg-color' form-type="submit">申请退款</button>
</view>
</form>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
<script>
import { ordeRefundReason, orderRefundVerify, getOrderDetail} from '@/api/order.js';
import { ordeRefundReason, orderRefundVerify, applyRefund} from '@/api/order.js';
import {
toLogin
} from '@/libs/login.js';
@@ -111,13 +107,7 @@
this.getOrderInfo();
this.getRefundReason();
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
methods: {
@@ -131,7 +121,7 @@
*/
getOrderInfo:function(){
let that=this;
getOrderDetail(that.orderId).then(res=>{
applyRefund(that.orderId).then(res=>{
that.$set(that,'orderInfo',res.data);
});
},
@@ -190,22 +180,25 @@
</script>
<style scoped lang="scss">
.apply-return .list{background-color:#fff;margin-top:18rpx;}
.apply-return .list .item{margin-left:30rpx;padding-right:30rpx;min-height:90rpx;border-bottom:1rpx solid #eee;font-size:30rpx;color:#333;}
.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:30rpx 30rpx 30rpx 0;}
.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{margin:22rpx 23rpx 0 0;width:156rpx;height:156rpx;position:relative;font-size:24rpx;color:#bbb;}
.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:3rpx;}
.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:690rpx;height:86rpx;border-radius:50rpx;text-align:center;line-height:86rpx;margin:43rpx auto;}
.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

@@ -0,0 +1,34 @@
<template>
<web-view class="web-view" :webview-styles="webviewStyles" :src="url" :style="{width: windowW + 'px', height: windowH + 'px'}"></web-view>
</template>
<script>
import {
mapGetters
} from "vuex";
export default {
computed: mapGetters(['chatUrl']),
data() {
return {
windowH: 0,
windowW: 0,
webviewStyles: {
progress: {
color: 'transparent'
}
},
url: ''
}
},
onLoad(option) {
this.url = this.chatUrl;
try {
const res = uni.getSystemInfoSync();
this.windowW = res.windowWidth;
this.windowH = res.windowHeight;
} catch (e) {
// error
}
}
}
</script>

View File

@@ -1,47 +1,37 @@
<template>
<div class="register absolute">
<div class="login-wrapper">
<div class="shading">
<div class="pictrue acea-row row-center-wrapper">
<image :src="logoUrl" v-if="logoUrl" />
<image src="/static/images/logo2.png" v-else />
</div>
<!-- <image :src="logoUrl"/> -->
<image :src="logoUrl"/>
<!-- <image src="/static/images/logo2.png" v-if="!logoUrl" /> -->
</div>
<div class="whiteBg" v-if="formItem === 1">
<div class="title acea-row row-center-wrapper">
<div class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList" @click="navTap(index)"
:key="index">
{{ item }}
</div>
</div>
<div class="list" :hidden="current !== 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"></image>
<input type="text" placeholder="输入手机号码" v-model="account" required />
<image src="/static/images/phone_1.png" style="width: 24rpx; height: 34rpx;"></image>
<input type="text" class="texts" placeholder="输入手机号码" v-model="account" required/>
</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" required />
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx;"></image>
<input type="password" class="texts" placeholder="填写登录密码" v-model="password" required />
</div>
</div>
</form>
<!-- <navigator class="forgetPwd" hover-class="none" url="/pages/users/retrievePassword/index">
<span class="iconfont icon-wenti"></span>忘记密码
</navigator> -->
</div>
<div class="list" :hidden="current !== 0">
<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"></image>
<input type="text" placeholder="输入手机号码" v-model="account" />
<image src="/static/images/phone_1.png" style="width: 24rpx; height: 34rpx;"></image>
<input type="text" class="texts" placeholder="输入手机号码" v-model="account" />
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png"></image>
<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">
{{ text }}
@@ -50,59 +40,19 @@
</div>
<div class="item" v-if="isShowCode">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png"></image>
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx;"></image>
<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="loginMobile" :hidden="current !== 0">登录</div>
<div class="logon" @click="submit" :hidden="current === 0">登录</div>
<div class="tip">
<div :hidden="current !== 1">
没有账号?
<span @click="current = 0" class="font-color-red">快速登录</span>
</div>
<div class="logon" @click="loginMobile" v-if="current !== 0">登录</div>
<div class="logon" @click="submit" v-if="current === 0">登录</div>
<div class="tips">
<div v-if="current==0" @click="current = 1">快速登录</div>
<div v-if="current==1" @click="current = 0">账号登录</div>
</div>
</div>
<!-- <div class="whiteBg" v-else>
<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_1.png"></image>
<input type="password" placeholder="填写您的登录密码" v-model="password" />
</div>
</div>
<div class="item" v-if="isShowCode">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png"></image>
<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="register">注册</div>
<div class="tip">
已有账号?
<span @click="formItem = 1" class="font-color-red">立即登录</span>
</div>
</div> -->
<div class="bottom"></div>
</div>
</template>
@@ -126,7 +76,7 @@
validatorDefaultCatch
} from "@/utils/dialog";
import {
getLogo
getLogo, appAuth, appleLogin
} from "@/api/public";
import {
VUE_APP_API_URL
@@ -140,7 +90,7 @@
data: function() {
return {
navList: ["快速登录", "账号登录"],
current: 0,
current: 1,
account: "",
password: "",
captcha: "",
@@ -150,7 +100,13 @@
keyCode: "",
codeUrl: "",
codeVal: "",
isShowCode: false
isShowCode: false,
platform: '',
appLoginStatus: false, // 微信登录强制绑定手机号码状态
appUserInfo: null, // 微信登录保存的用户信息
appleLoginStatus: false, // 苹果登录强制绑定手机号码状态
appleUserInfo: null,
appleShow: false // 苹果登录版本必须要求ios13以上的
};
},
watch:{
@@ -166,7 +122,143 @@
this.getCode();
this.getLogoImage();
},
onLoad() {
let self = this
uni.getSystemInfo({
success: function(res) {
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()
}
});
},
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('用户点击取消');
}
}
});
})
},
// App微信登录
wxLogin() {
let self = this
this.account = ''
this.captcha = ''
uni.showLoading({
title: '登录中'
})
uni.login({
provider: 'weixin',
success: function(loginRes) {
// 获取用户信息
uni.getUserInfo({
provider: 'weixin',
success: function(infoRes) {
uni.hideLoading();
self.appUserInfo = infoRes.userInfo
self.appUserInfo.type = self.platform === 'ios' ? 'iosWx' : 'androidWx'
self.wxLoginGo(self.appUserInfo)
},
fail() {
uni.hideLoading();
uni.showToast({
title: '获取用户信息失败',
icon: 'none',
duration: 2000
})
},
complete() {
uni.hideLoading()
}
});
},
fail() {
uni.hideLoading()
uni.showToast({
title: '登录失败',
icon: 'none',
duration: 2000
})
}
});
},
wxLoginGo(userInfo) {
appAuth(userInfo).then(res => {
if (res.data.type === 'register') {
uni.navigateTo({
url: '/pages/users/app_login/index?authKey='+res.data.key
})
}
if (res.data.type === 'login') {
this.$store.commit("LOGIN", {
'token': res.data.token
});
this.getUserInfo(res.data);
}
}).catch(res => {
that.$util.Tips({
title: res
});
});
},
again() {
this.codeUrl =
VUE_APP_API_URL +
@@ -177,20 +269,11 @@
},
getCode() {
let that = this
// getCodeApi()
// .then(res => {
// that.keyCode = res.data.key;
// })
// .catch(res => {
// that.$util.Tips({
// title: res
// });
// });
},
async getLogoImage() {
let that = this;
getLogo().then(res => {
that.logoUrl = res.data.logoUrl;
that.logoUrl = res.data.logoUrl?res.data.logoUrl:'/static/images/logo2.png';
});
},
async loginMobile() {
@@ -208,34 +291,17 @@
title: '请输入正确的验证码'
});
loginMobile({
account: that.account,
phone: that.account,
captcha: that.captcha,
spread: that.$Cache.get("spread")
spread_spid: that.$Cache.get("spread")
})
.then(res => {
let data = res.data;
let newTime = Math.round(new Date() / 1000);
that.$store.commit("LOGIN", {
'token': data.token
// 'time': dayjs(data.expiresTime) - newTime
this.$store.commit("LOGIN", {
'token': res.data.token
});
const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
that.$Cache.clear(BACK_URL);
// getUserInfo().then(res => {
that.$store.commit("SETUID", res.data.user.uid);
if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl ===
'/pages/user/index') {
uni.switchTab({
url: backUrl
});
} else {
uni.switchTab({
url: '/pages/index/index'
});
}
// })
that.getUserInfo(data);
})
.catch(res => {
that.$util.Tips({
@@ -290,21 +356,15 @@
title: '请输入正确的手机号码'
});
if (that.formItem == 2) that.type = "register";
// phone: that.account
// type: that.type,
// key: that.keyCode,
// code: that.codeVal
await registerVerify(that.account)
.then(res => {
that.$util.Tips({title: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.message});
.catch(err => {
return that.$util.Tips({
title: err
});
});
},
navTap: function(index) {
@@ -329,44 +389,210 @@
.then(({
data
}) => {
// let newTime = Math.round(new Date() / 1000);
that.$store.commit("LOGIN", {
this.$store.commit("LOGIN", {
'token': data.token
// 'time': dayjs(data.expiresTime) - newTime
});
const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
that.$Cache.clear(BACK_URL);
getUserInfo().then(res => {
that.$store.commit("SETUID", res.data.uid);
if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl ==='/pages/user/index') {
uni.switchTab({
url: backUrl
});
} else {
uni.switchTab({
url: '/pages/index/index'
});
}
})
that.getUserInfo(data);
})
.catch(e => {
that.$util.Tips({
title: e
});
});
},
getUserInfo(data){
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) {
backUrl = '/pages/index/index';
}
uni.reLaunch({
url: backUrl
});
})
}
}
};
</script>
<style lang="scss">
<style lang="scss" scoped>
page {
background: #fff;
}
.appLogin {
margin-top: 60rpx;
.hds {
display: flex;
justify-content: center;
align-items: center;
font-size: 24rpx;
color: #B4B4B4;
.line {
width: 68rpx;
height: 1rpx;
background: #CCCCCC;
}
p {
margin: 0 20rpx;
}
}
.btn-wrapper {
display: flex;
align-items: center;
justify-content: center;
margin-top: 30rpx;
.btn {
display: flex;
align-items: center;
justify-content: center;
width: 68rpx;
height: 68rpx;
border-radius: 50%;
}
.apple-btn {
display: flex;
align-items: center;
justify-content: center;
margin-left: 30rpx;
background: #000;
border-radius: 34rpx;
font-size: 40rpx;
.icon-s-pingguo {
color: #fff;
font-size: 40rpx;
}
}
.iconfont {
font-size: 40rpx;
color: #fff;
}
.wx {
margin-right: 30rpx;
background-color: #61C64F;
}
.mima {
background-color: #28B3E9;
}
.yanzheng {
background-color: #F89C23;
}
}
}
.code img {
width: 100%;
height: 100%;
}
.acea-row.row-middle {
input {
margin-left: 20rpx;
display: block;
}
}
</style>
.login-wrapper {
padding: 30rpx;
.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;
}
}
.whiteBg {
margin-top: 100rpx;
.list {
border-radius: 16rpx;
overflow: hidden;
.item {
border-bottom: 1px solid #F0F0F0;
background: #fff;
.row-middle {
position: relative;
padding: 16rpx 45rpx;
.texts{
flex: 1;
font-size: 28rpx;
height: 80rpx;
line-height: 80rpx;
display: flex;
justify-content: center;
align-items: center;
}
input {
flex: 1;
font-size: 28rpx;
height: 80rpx;
line-height: 80rpx;
display: flex;
justify-content: center;
align-items: center;
}
.code {
position: absolute;
right: 30rpx;
top: 50%;
color: $theme-color;
font-size: 26rpx;
transform: translateY(-50%);
}
}
}
}
.logon {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 86rpx;
margin-top: 80rpx;
background-color: $theme-color;
border-radius: 120rpx;
color: #FFFFFF;
font-size: 30rpx;
}
.tips {
margin: 30rpx;
text-align: center;
color: #999;
}
}
}
</style>

View File

@@ -1,17 +1,23 @@
<template>
<view>
<view class='order-submission'>
<view class="allAddress" :style="store_self_mention ? '':'padding-top:10rpx'">
<view class="allAddress" :style="store_self_mention ? '':'padding-top:10rpx;'">
<view class="nav acea-row">
<view class="item font-color" :class="shippingType == 0 ? 'on' : 'on2'" @tap="addressType(0)" v-if='store_self_mention'></view>
<view class="item font-color" :class="shippingType == 1 ? 'on' : 'on2'" @tap="addressType(1)" v-if='store_self_mention'></view>
<view class="item font-color" :class="shippingType == 0 ? 'on' : 'on2'" @tap="addressType(0)"
v-if='store_self_mention'></view>
<view class="item font-color" :class="shippingType == 1 ? 'on' : 'on2'" @tap="addressType(1)"
v-if='store_self_mention'></view>
</view>
<view class='address acea-row row-between-wrapper' @tap='onAddress' v-if='shippingType == 0'>
<view class='address acea-row row-between-wrapper' @tap='onAddress' v-if='shippingType == 0' :style="store_self_mention ? '':'border-top-left-radius: 14rpx;border-top-right-radius: 14rpx;'">
<view class='addressCon' v-if="addressInfo.realName">
<view class='name'>{{addressInfo.realName}}
<text class='phone'>{{addressInfo.phone}}</text>
</view>
<view><text class='default font-color' v-if="addressInfo.isDefault">[默认]</text>{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{addressInfo.detail}}</view>
<view class="acea-row">
<text class='default font-color'
v-if="addressInfo.isDefault">[默认]</text>
<text class="line2">{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{addressInfo.detail}}</text>
</view>
</view>
<view class='addressCon' v-else>
<view class='setaddress'>设置收货地址</view>
@@ -24,7 +30,8 @@
<view class='name'>{{system_store.name}}
<text class='phone'>{{system_store.phone}}</text>
</view>
<view class="line1"> {{system_store.address}}{{", " + system_store.detailedAddress}}</view>
<view class="line1"> {{system_store.address}}{{", " + system_store.detailedAddress}}
</view>
</view>
<view class='iconfont icon-jiantou'></view>
</block>
@@ -36,129 +43,134 @@
<image src='/static/images/line.jpg'></image>
</view>
</view>
<orderGoods :cartInfo="cartInfo"></orderGoods>
<view class='wrapper'>
<view class='item acea-row row-between-wrapper' @tap='couponTap' v-if="!pinkId && !BargainId && !combinationId && !seckillId">
<view>优惠券</view>
<view class='discount'>{{couponTitle}}
<text class='iconfont icon-jiantou'></text>
</view>
</view>
<view class='item acea-row row-between-wrapper' v-if="!pinkId && !BargainId && !combinationId && !seckillId">
<view>积分抵扣</view>
<view class='discount acea-row row-middle'>
<view> {{useIntegral ? "剩余积分":"当前积分"}}
<text class='num font-color'>{{integral || 0}}</text>
</view>
<checkbox-group @change="ChangeIntegral">
<checkbox :checked='useIntegral ? true : false' />
</checkbox-group>
</view>
</view>
<view class='item acea-row row-between-wrapper' v-if="priceGroup.vipPrice > 0 && userInfo.vip && !pinkId && !BargainId && !combinationId && !seckillId">
<view>会员优惠</view>
<view class='discount'>-{{priceGroup.vipPrice}}</view>
</view>
<view class='item acea-row row-between-wrapper' v-if='shippingType==0'>
<view>快递费用</view>
<view class='discount' v-if='parseFloat(priceGroup.storePostage) > 0'>+¥{{priceGroup.storePostage}}</view>
<view class='discount' v-else>免运费</view>
</view>
<view v-else>
<view class="item acea-row row-between-wrapper">
<view>联系人</view>
<view class="discount textR">
<input type="text" placeholder="请填写您的联系姓名" placeholder-class="placeholder" @blur='realName'></input>
<view class="pad30">
<orderGoods :cartInfo="cartInfo" :orderProNum="orderProNum"></orderGoods>
<view class='wrapper borRadius14'>
<view class='item acea-row row-between-wrapper' @tap='couponTap'
v-if="!orderInfoVo.bargainId && !orderInfoVo.combinationId && !orderInfoVo.seckillId && productType==='normal'">
<view>优惠券</view>
<view class='discount'>{{couponTitle}}
<text class='iconfont icon-jiantou'></text>
</view>
</view>
<view class="item acea-row row-between-wrapper">
<view>联系电话</view>
<view class="discount textR">
<input type="text" placeholder="请填写您的联系电话" placeholder-class="placeholder" @blur='phone'></input>
<view class='item acea-row row-between-wrapper'
v-if="!orderInfoVo.bargainId && !orderInfoVo.combinationId && !orderInfoVo.seckillId && productType==='normal'">
<view>积分抵扣</view>
<!-- -->
<view class='discount acea-row row-middle'>
<view> {{useIntegral ? "剩余积分":"当前积分"}}
<text class='num font-color'>{{useIntegral ? orderInfoVo.surplusIntegral : orderInfoVo.userIntegral || 0}}</text>
</view>
<checkbox-group @change="ChangeIntegral">
<checkbox :checked='useIntegral ? true : false' :disabled="orderInfoVo.userIntegral==0 && !useIntegral"/>
</checkbox-group>
</view>
</view>
</view>
<!-- <view class='item acea-row row-between-wrapper' wx:else>
<!-- <view class='item acea-row row-between-wrapper'
v-if="priceGroup.vipPrice > 0 && userInfo.vip && !pinkId && !BargainId && !combinationId && !seckillId">
<view>会员优惠</view>
<view class='discount'>-{{priceGroup.vipPrice}}</view>
</view> -->
<view class='item acea-row row-between-wrapper' v-if='shippingType==0'>
<view>快递费用</view>
<view class='discount' v-if='parseFloat(orderInfoVo.freightFee) > 0'>
+¥{{orderInfoVo.freightFee}}
</view>
<view class='discount' v-else>免运费</view>
</view>
<view v-else>
<view class="item acea-row row-between-wrapper">
<view>联系人</view>
<view class="discount textR">
<input type="text" placeholder="请填写您的联系姓名" placeholder-style="color:#ccc;" placeholder-class="placeholder"
@blur='realName'></input>
</view>
</view>
<view class="item acea-row row-between-wrapper">
<view>联系电话</view>
<view class="discount textR">
<input type="text" placeholder="请填写您的联系电话" placeholder-style="color:#ccc;" placeholder-class="placeholder"
@blur='phone'></input>
</view>
</view>
</view>
<!-- <view class='item acea-row row-between-wrapper' wx:else>
<view>自提门店</view>
<view class='discount'>{{system_store.name}}</view>
</view> -->
<view class='item' v-if="textareaStatus">
<view>备注信息</view>
<textarea v-if="coupon.coupon===false" placeholder-class='placeholder' @input='bindHideKeyboard' value="" name="mark"
placeholder='请添加备注150字以内'></textarea>
</view>
</view>
<view class='wrapper'>
<view class='item'>
<view>支付方式</view>
<view class='list'>
<view class='payItem acea-row row-middle' :class='active==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>
<!-- #ifdef MP || APP-PLUS -->
<!-- <view class='payItem acea-row row-middle' :class='active==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> -->
<!-- #endif -->
<view class='item' v-if="textareaStatus">
<view>备注信息</view>
<textarea v-if="coupon.coupon===false" placeholder-class='placeholder' @input='bindHideKeyboard'
value="" name="mark" placeholder='请添加备注150字以内'></textarea>
</view>
</view>
<view class='wrapper borRadius14'>
<view class='item'>
<view>支付方式</view>
<view class='list'>
<view class='payItem acea-row row-middle' :class='active==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>
<view class='moneyList borRadius14'>
<view class='item acea-row row-between-wrapper'>
<view>商品总价:</view>
<view class='money'>¥{{orderInfoVo.proTotalFee || 0}}</view>
</view>
<view class='item acea-row row-between-wrapper' v-if="orderInfoVo.couponFee > 0">
<view>优惠券抵扣:</view>
<view class='money'>-¥{{orderInfoVo.couponFee}}</view>
</view>
<view class='item acea-row row-between-wrapper' v-if="orderInfoVo.deductionPrice > 0">
<view>积分抵扣:</view>
<view class='money'>-¥{{orderInfoVo.deductionPrice}}</view>
</view>
<view class='item acea-row row-between-wrapper' v-if="orderInfoVo.freightFee > 0">
<view>运费:</view>
<view class='money'>+¥{{orderInfoVo.freightFee}}</view>
</view>
</view>
<view style='height:120rpx;'></view>
</view>
<view class='moneyList'>
<view class='item acea-row row-between-wrapper'>
<view>商品总价:</view>
<view class='money'>¥{{priceGroup.totalPrice}}</view>
</view>
<view class='item acea-row row-between-wrapper' v-if="coupon_price > 0">
<view>优惠券抵扣:</view>
<view class='money'>-¥{{coupon_price}}</view>
</view>
<view class='item acea-row row-between-wrapper' v-if="integral_price > 0">
<view>积分抵扣:</view>
<view class='money'>-¥{{integral_price}}</view>
</view>
<view class='item acea-row row-between-wrapper' v-if="priceGroup.storePostage > 0">
<view>运费:</view>
<view class='money'>+¥{{priceGroup.storePostage}}</view>
</view>
</view>
<view style='height:120rpx;'></view>
<view class='footer acea-row row-between-wrapper'>
<view>合计:
<text class='font-color'>¥{{totalPrice || 0}}</text>
<text class='font-color'>¥{{orderInfoVo.payFee || 0}}</text>
</view>
<view class='settlement' style='z-index:100' @tap="SubOrder">立即结算</view>
</view>
</view>
<couponListWindow :coupon='coupon' @ChangCouponsClone="ChangCouponsClone" :openType='openType' :cartId='cartId'
@ChangCoupons="ChangCoupons"></couponListWindow>
<addressWindow ref="addressWindow" @changeTextareaStatus="changeTextareaStatus" :address='address' :pagesUrl="pagesUrl"
@OnChangeAddress="OnChangeAddress" @changeClose="changeClose"></addressWindow>
<couponListWindow :coupon='coupon' @ChangCouponsClone="ChangCouponsClone" :openType='openType' @ChangCoupons="ChangCoupons" :orderShow="orderShow"></couponListWindow>
<addressWindow ref="addressWindow" @changeTextareaStatus="changeTextareaStatus" :address='address'
:pagesUrl="pagesUrl" @OnDefaultAddress="OnDefaultAddress" @OnChangeAddress="OnChangeAddress" @changeClose="changeClose"></addressWindow>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
<script>
import {
orderConfirm,
//orderConfirm,
getCouponsOrderPrice,
orderCreate,
postOrderComputed,
orderPay,
wechatOrderPay,
wechatQueryPayResult
wechatQueryPayResult,
loadPreOrderApi
} from '@/api/order.js';
import {
getAddressDefault,
getAddressList,
getAddressDetail
} from '@/api/user.js';
import {
@@ -196,6 +208,7 @@
},
data() {
return {
orderShow: 'orderShow', //下单页面使用优惠券组件不展示tab切换页
textareaStatus: true,
//支付方式
cartArr: [{
@@ -211,14 +224,14 @@
value: 'yue',
title: '可用余额:',
payStatus: 1,
},
{
"name": "线下支付", //offlinePayStatu1开启线下支付2关闭offlinePostagetrue有邮费
"icon": "icon-yinhangqia",
value: 'offline',
title: '线下支付',
payStatus: 1,
},
}
// {
// "name": "线下支付", //offlinePayStatu1开启线下支付2关闭offlinePostagetrue有邮费
// "icon": "icon-yinhangqia",
// value: 'offline',
// title: '线下支付',
// payStatus: 1,
// },
],
payType: 'weixin', //支付方式
openType: 1, //优惠券打开方式 1=使用
@@ -229,16 +242,13 @@
statusTile: '立即使用'
}, //优惠券组件
address: {
address: false
address: false,
addressId: 0
}, //地址组件
addressInfo: {}, //地址信息
pinkId: 0, //拼团id
addressId: 0, //地址id
couponId: 0, //优惠券id
cartId: '', //购物车id
BargainId: 0,
combinationId: 0,
seckillId: 0,
userInfo: {}, //用户信息
mark: '', //备注信息
couponTitle: '请选择', //优惠券
@@ -277,57 +287,45 @@
bargain: false, //是否是砍价
combination: false, //是否是拼团
secKill: false, //是否是秒杀
orderInfoVo: {},
addressList: [], //地址列表数据
orderProNum: 0,
preOrderNo: '' //预下单订单号
};
},
computed: mapGetters(['isLogin']),
watch:{
isLogin:{
handler:function(newV,oldV){
if(newV){
this.getaddressInfo();
this.getConfirm();
computed: mapGetters(['isLogin', 'systemPlatform', 'productType']),
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getloadPreOrder();
//this.getaddressInfo();
}
},
deep:true
deep: true
}
},
onLoad: function(options) {
onLoad(options) {
// #ifdef H5
this.payChannel = this.$wechat.isWeixin() ? 'public' : 'weixinh5'
this.payChannel = this.$wechat.isWeixin() ? 'public' : 'weixinh5';
// #endif
// #ifdef MP
this.payChannel = 'routine'
this.payChannel = 'routine';
// #endif
if (!options.cartId) return this.$util.Tips({
title: '请选择要购买的商品'
}, {
tab: 3,
url: 1
});
this.couponId = options.couponId || 0;
this.pinkId = options.pinkId ? parseInt(options.pinkId) : 0;
// if (!options.cartId) return this.$util.Tips({
// title: '请选择要购买的商品'
// }, {
// tab: 3,
// url: 1
// });
this.preOrderNo = options.preOrderNo || 0;
this.addressId = options.addressId || 0;
this.cartId = options.cartId;
this.is_address = options.is_address ? true : false;
this.news = options.new || true;
this.again = options.again || false;
this.addAgain = options.addAgain || false;
this.secKill = options.secKill || false;
this.combination = options.combination || false;
this.bargain = options.bargain || false;
if (this.isLogin) {
this.getaddressInfo();
this.getConfirm();
//调用子页面方法授权后执行获取地址列表
this.$nextTick(function() {})
//this.getaddressInfo();
this.getloadPreOrder();
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
/**
@@ -335,12 +333,11 @@
*/
onShow: function() {
let _this = this
// wx.getLaunchOptionsSync
this.textareaStatus = true;
if (this.isLogin && this.toPay == false) {
this.getaddressInfo();
this.$nextTick(function() {
this.$refs.addressWindow.getAddressList();
})
//this.getaddressInfo();
}
uni.$on("handClick", res => {
@@ -366,13 +363,34 @@
// this.isClose = true
// },
methods: {
// 订单详情
getloadPreOrder: function() {
loadPreOrderApi(this.preOrderNo).then(res => {
let orderInfoVo = res.data.orderInfoVo
this.orderInfoVo = orderInfoVo;
this.cartInfo = orderInfoVo.orderDetailList;
this.orderProNum = orderInfoVo.orderProNum;
this.address.addressId = this.addressId ? this.addressId :orderInfoVo.addressId;
this.cartArr[1].title = '可用余额:' + orderInfoVo.userBalance;
this.cartArr[1].payStatus = parseInt(res.data.yuePayStatus) === 1 ? 1 : 2;
this.cartArr[0].payStatus = parseInt(res.data.payWeixinOpen) === 1 ? 1 : 0;
this.store_self_mention = res.data.storeSelfMention == 'true'&& this.productType === 'normal' ? true : false;
//调用子页面方法授权后执行获取地址列表
this.$nextTick(function() {
this.$refs.addressWindow.getAddressList();
})
}).catch(err => {
return this.$util.Tips({
title: err
});
})
},
/**
* 授权回调事件
*
*/
onLoadFun: function() {
this.getaddressInfo();
this.getConfirm();
//this.getaddressInfo();
//调用子页面方法授权后执行获取地址列表
// this.$scope.selectComponent('#address-window').getAddressList();
},
@@ -414,23 +432,28 @@
})
}
},
// 计算订单价格
computedPrice: function() {
let shippingType = this.shippingType;
postOrderComputed(this.orderKey, {
addressId: this.addressId,
useIntegral: this.useIntegral ? 1 : 0,
postOrderComputed({
addressId: this.address.addressId,
useIntegral: this.useIntegral ? true : false,
couponId: this.couponId,
shippingType: parseInt(shippingType) + 1,
payType: this.payType
preOrderNo: this.preOrderNo
}).then(res => {
let result = res.data.result.result;
if (result) {
this.totalPrice = result.orderId.payPrice;
this.integral_price = result.orderId.deductionPrice;
this.coupon_price = result.orderId.couponPrice;
this.integral = this.useIntegral ? result.orderId.surplusIntegral : this.userInfo.integral;
this.$set(this.priceGroup, 'storePostage', shippingType == 1 ? 0 : result.orderId.payPostage);
}
let data = res.data;
this.orderInfoVo.couponFee = data.couponFee;
//赋值操作userIntegral 当前积分surplusIntegral 剩余积分
this.orderInfoVo.userIntegral = data.surplusIntegral;
this.orderInfoVo.deductionPrice = data.deductionPrice;
this.orderInfoVo.freightFee = data.freightFee;
this.orderInfoVo.payFee = data.payFee;
this.orderInfoVo.proTotalFee = data.proTotalFee;
this.orderInfoVo.useIntegral = data.useIntegral;
this.orderInfoVo.usedIntegral = data.usedIntegral;
this.orderInfoVo.surplusIntegral = data.surplusIntegral;
//this.orderInfoVo.userIntegral = data.userIntegral;
}).catch(err => {
return this.$util.Tips({
title: err
@@ -501,92 +524,37 @@
this.useIntegral = !this.useIntegral;
this.computedPrice();
},
/**
* 首次进页面展示默认地址
*/
OnDefaultAddress: function(e) {
this.addressInfo = e;
this.address.addressId = e.id;
},
/**
* 选择地址后改变事件
* @param object e
*/
OnChangeAddress: function(e) {
this.addressInfo = e;
this.address.addressId = e.id;
this.textareaStatus = true;
this.addressId = e;
//this.orderInfoVo.addressId = e;
this.address.address = false;
this.getaddressInfo();
//this.getaddressInfo();
this.computedPrice();
},
bindHideKeyboard: function(e) {
this.mark = e.detail.value;
},
/**
* 获取当前订单详细信息
*
*/
getConfirm: function() {
let that = this;
orderConfirm(that.cartId, that.news, this.addAgain, this.secKill, this.combination, this.bargain).then(res => {
that.$set(that, 'userInfo', res.data.userInfo);
that.$set(that, 'integral', res.data.userInfo.integral);
that.$set(that, 'cartInfo', res.data.cartInfo);
that.$set(that, 'integralRatio', res.data.integralRatio);
that.$set(that, 'offlinePostage', res.data.offlinePostage);
that.$set(that, 'orderKey', res.data.orderKey);
that.$set(that, 'priceGroup', res.data.priceGroup);
that.$set(that, 'totalPrice', that.$util.$h.Add(parseFloat(res.data.priceGroup.totalPrice), parseFloat(res.data
.priceGroup.storePostage)));
that.$set(that, 'seckillId', parseInt(res.data.secKillId));
that.$set(that, 'store_self_mention', res.data.storeSelfMention == 'true' ? true : false);
that.cartArr[1].title = '可用余额:' + res.data.userInfo.nowMoney;
that.cartArr[0].payStatus = res.data.payWeixinOpen || 0
that.cartArr[1].payStatus = res.data.yuePayStatus || 0
if (res.data.offlinePayStatus == 1) {
that.cartArr[2].payStatus = 1
} else {
that.cartArr[2].payStatus = 0
}
// that.$set(that, 'cartArr', that.cartArr);
that.$set(that, 'ChangePrice', that.totalPrice);
that.getBargainId();
if (!that.secKill) that.getCouponList();
}).catch(err => {
return this.$util.Tips({
title: err
}, {
tab: 3,
url: 1
});
});
},
/*
* 提取砍价和拼团id
*/
getBargainId: function() {
let that = this;
let cartINfo = that.cartInfo;
let BargainId = 0;
let combinationId = 0;
cartINfo.forEach(function(value, index, cartINfo) {
BargainId = cartINfo[index].bargainId || 0,
combinationId = cartINfo[index].combinationId || 0
})
that.$set(that, 'BargainId', parseInt(BargainId));
that.$set(that, 'combinationId', parseInt(combinationId));
if (that.cartArr.length == 3 && (BargainId || combinationId || that.seckillId)) {
that.cartArr[2].payStatus = 0;
that.$set(that, 'cartArr', that.cartArr);
}
},
/**
* 获取当前金额可用优惠券
*
*/
getCouponList: function() {
let that = this;
let data = {
cartId: this.cartId
}
getCouponsOrderPrice(data).then(res => {
that.$set(that.coupon, 'list', res.data);
that.openType = 1;
getCouponsOrderPrice(this.preOrderNo).then(res => {
this.$set(this.coupon, 'list', res.data);
this.openType = 1;
});
},
/*
@@ -627,6 +595,7 @@
},
couponTap: function() {
this.coupon.coupon = true;
if(!this.coupon.list.length)this.getCouponList();
},
car: function() {
let that = this;
@@ -636,9 +605,7 @@
let that = this;
that.textareaStatus = false;
that.address.address = true;
that.pagesUrl = '/pages/users/user_address_list/index?cartId=' + this.cartId + '&pinkId=' + this.pinkId +
'&couponId=' + this.couponId + '&secKill=' + this.secKill + '&combination=' + this.combination + '&bargain=' +
this.bargain;
that.pagesUrl = '/pages/users/user_address_list/index?preOrderNo='+ this.preOrderNo;
},
realName: function(e) {
this.contacts = e.detail.value;
@@ -648,12 +615,8 @@
},
payment: function(data) {
let that = this;
orderCreate(that.orderKey, data).then(res => {
orderCreate(data).then(res => {
that.getOrderPay(res.data.orderNo, '支付成功');
// if(that.totalPrice===0)return that.$util.Tips({
// title: '支付成功',
// icon: 'success'
// });
}).catch(err => {
uni.hideLoading();
@@ -667,13 +630,9 @@
let goPages = '/pages/order_pay_status/index?order_id=' + orderNo + '&msg=' + message;
wechatOrderPay({
orderNo: orderNo,
// #ifdef MP
payChannel: 'routine',
// #endif
// #ifdef H5 || APP-PLUS
payChannel: that.$wechat.isWeixin() ? 'public' : 'weixinh5',
// #endif
payType: that.payType
payChannel: that.payChannel,
payType: that.payType,
scene: that.productType==='normal'? 0 :1177 //下单时小程序的场景值
}).then(res => {
let jsConfig = res.data.jsConfig;
switch (res.data.payType) {
@@ -685,23 +644,34 @@
package: jsConfig.packages,
signType: jsConfig.signType,
paySign: jsConfig.paySign,
ticket: that.productType==='normal'? null : jsConfig.ticket,
success: function(ress) {
uni.hideLoading();
if (that.BargainId || that.combinationId || that.pinkId || that.seckillId)
wechatQueryPayResult(orderNo).then(res => {
uni.hideLoading();
if (that.orderInfoVo.bargainId || that.orderInfoVo.combinationId || that.pinkId || that
.orderInfoVo.seckillId)
return that.$util.Tips({
title: '支付成功',
icon: 'success'
}, {
tab: 4,
url: goPages
});
return that.$util.Tips({
title: '支付成功',
icon: 'success'
}, {
tab: 4,
tab: 5,
url: goPages
});
return that.$util.Tips({
title: '支付成功',
icon: 'success'
}, {
tab: 5,
url: goPages
});
}).cache(err => {
uni.hideLoading();
return that.$util.Tips({
title: err
});
})
},
fail: function(e) {
uni.hideLoading();
@@ -715,12 +685,13 @@
complete: function(e) {
uni.hideLoading();
//关闭当前页面跳转至订单状态
if (e.errMsg == 'requestPayment:cancel') return that.$util.Tips({
title: '取消支付'
}, {
tab: 5,
url: goPages + '&status=2'
});
if (e.errMsg == 'requestPayment:cancel') return that.$util
.Tips({
title: '取消支付'
}, {
tab: 5,
url: goPages + '&status=2'
});
},
})
// #endif
@@ -734,6 +705,7 @@
};
that.$wechat.pay(data).then(res => {
if (res.errMsg == 'chooseWXPay:cancel') {
uni.hideLoading();
return that.$util.Tips({
title: '取消支付'
}, {
@@ -741,9 +713,8 @@
url: goPages + '&status=2'
});
} else {
wechatQueryPayResult({
orderNo: orderNo
}).then(res => {
wechatQueryPayResult(orderNo).then(res => {
uni.hideLoading();
return that.$util.Tips({
title: '支付成功',
icon: 'success'
@@ -752,12 +723,14 @@
url: goPages
});
}).cache(err => {
uni.hideLoading();
return that.$util.Tips({
title: err
});
})
}
}).cache(res => {
uni.hideLoading();
return that.$util.Tips({
title: '取消支付'
}, {
@@ -785,7 +758,8 @@
url: goPages + '&status=0'
});
setTimeout(() => {
location.href = jsConfig.mwebUrl + '&redirect_url=' + window.location.protocol + '//' + window.location.host +
location.href = jsConfig.mwebUrl + '&redirect_url=' + window.location
.protocol + '//' + window.location.host +
goPages + '&status=1';
}, 100)
break;
@@ -814,7 +788,7 @@
break;
case 'SUCCESS':
uni.hideLoading();
if (that.BargainId || that.combinationId || that.pinkId || that.seckillId)
if (that.orderInfoVo.bargainId || that.orderInfoVo.combinationId || that.pinkId || that.orderInfoVo.seckillId)
return that.$util.Tips({
title: message,
icon: 'success'
@@ -833,16 +807,16 @@
case 'WECHAT_PAY':
// #ifdef MP
that.toPay = true;
let packages = 'prepay_id=' + jsConfig.prepayId;
let packagess = 'prepay_id=' + jsConfig.prepayId;
uni.requestPayment({
timeStamp: jsConfig.timeStamp.toString(),
nonceStr: jsConfig.nonceStr,
package: packages,
package: packagess,
signType: jsConfig.signType,
paySign: jsConfig.paySign,
success: function(res) {
uni.hideLoading();
if (that.BargainId || that.combinationId || that.pinkId || that.seckillId)
if (that.orderInfoVo.bargainId || that.orderInfoVo.combinationId || that.pinkId || that.orderInfoVo.seckillId)
return that.$util.Tips({
title: '支付成功',
icon: 'success'
@@ -941,7 +915,7 @@
if (!that.payType) return that.$util.Tips({
title: '请选择支付方式'
});
if (!that.addressId && !that.shippingType) return that.$util.Tips({
if (!that.address.addressId && !that.shippingType) return that.$util.Tips({
title: '请选择收货地址'
});
if (that.shippingType == 1) {
@@ -967,26 +941,22 @@
data = {
realName: that.contacts,
phone: that.contactsTel,
addressId: that.addressId,
formId: '',
addressId: that.address.addressId,
couponId: that.couponId,
payType: that.payType,
useIntegral: that.useIntegral,
bargainId: that.BargainId,
combinationId: that.combinationId,
pinkId: that.pinkId,
seckillId: that.seckillId,
preOrderNo: that.preOrderNo,
mark: that.mark,
storeId: that.system_store.id || 0,
shippingType: that.$util.$h.Add(that.shippingType, 1),
isNew: that.news,
payChannel: that.payChannel
};
if (data.payType == 'yue' && parseFloat(that.userInfo.nowMoney) < parseFloat(that.totalPrice)) return that.$util
.Tips({
title: '余额不足!'
});
if (data.payType == 'yue' && parseFloat(that.userInfo.nowMoney) < parseFloat(that.totalPrice))
return that.$util
.Tips({
title: '余额不足!'
});
uni.showLoading({
title: '订单支付中'
});
@@ -998,13 +968,15 @@
// #ifndef MP
that.payment(data);
// #endif
// that.payment(data);
}
}
}
</script>
<style lang="scss" scoped>
.line2{
width: 504rpx;
}
.textR {
text-align: right;
}
@@ -1021,13 +993,13 @@
}
.order-submission .address {
padding: 28rpx 30rpx;
padding: 28rpx;
background-color: #fff;
box-sizing: border-box;
}
.order-submission .address .addressCon {
width: 610rpx;
width: 596rpx;
font-size: 26rpx;
color: #666;
}
@@ -1063,21 +1035,21 @@
// background-image: linear-gradient(to bottom, #e93323 0%, #f5f5f5 100%);
// background-image: -webkit-linear-gradient(to bottom, #e93323 0%, #f5f5f5 100%);
// background-image: -moz-linear-gradient(to bottom, #e93323 0%, #f5f5f5 100%);
padding-top: 100rpx;
padding: 100rpx 30rpx 0 30rpx;
}
.order-submission .allAddress .nav {
width: 710rpx;
width: 690rpx;
margin: 0 auto;
}
.order-submission .allAddress .nav .item {
width: 355rpx;
width: 334rpx;
}
.order-submission .allAddress .nav .item.on {
position: relative;
width: 250rpx;
width: 230rpx;
}
.order-submission .allAddress .nav .item.on::before {
@@ -1092,7 +1064,7 @@
border-style: none solid solid;
border-color: transparent transparent #fff;
z-index: 2;
border-radius: 7rpx 30rpx 0 0;
border-radius: 14rpx 36rpx 0 0;
text-align: center;
line-height: 80rpx;
}
@@ -1100,7 +1072,7 @@
.order-submission .allAddress .nav .item:nth-of-type(2).on::before {
content: "到店自提";
border-width: 0 0 80rpx 20rpx;
border-radius: 30rpx 7rpx 0 0;
border-radius: 36rpx 14rpx 0 0;
}
.order-submission .allAddress .nav .item.on2 {
@@ -1114,11 +1086,11 @@
font-size: 28rpx;
display: block;
height: 0;
width: 400rpx;
width: 401rpx;
border-width: 0 0 60rpx 60rpx;
border-style: none solid solid;
border-color: transparent transparent #f7c1bd;
border-radius: 40rpx 6rpx 0 0;
border-radius: 36rpx 14rpx 0 0;
text-align: center;
line-height: 60rpx;
}
@@ -1126,17 +1098,17 @@
.order-submission .allAddress .nav .item:nth-of-type(1).on2::before {
content: "快递配送";
border-width: 0 60rpx 60rpx 0;
border-radius: 6rpx 40rpx 0 0;
border-radius: 14rpx 36rpx 0 0;
}
.order-submission .allAddress .address {
width: 710rpx;
height: 150rpx;
width: 690rpx;
max-height: 180rpx;
margin: 0 auto;
}
.order-submission .allAddress .line {
width: 710rpx;
width: 100%;
margin: 0 auto;
}
@@ -1146,19 +1118,19 @@
.order-submission .wrapper {
background-color: #fff;
margin-top: 13rpx;
margin-top: 15rpx;
}
.order-submission .wrapper .item {
padding: 27rpx 30rpx;
padding: 27rpx 24rpx;
font-size: 30rpx;
color: #282828;
border-bottom: 1px solid #f0f0f0;
color: #333333;
border-bottom: 1px solid #F5F5F5;
}
.order-submission .wrapper .item .discount {
font-size: 30rpx;
color: #999;
color: #333;
}
.order-submission .wrapper .item .discount .iconfont {
@@ -1191,12 +1163,13 @@
.order-submission .wrapper .item textarea {
background-color: #f9f9f9;
width: 690rpx;
width: auto !important;
height: 140rpx;
border-radius: 3rpx;
border-radius: 14rpx;
margin-top: 30rpx;
padding: 25rpx 28rpx;
padding: 15rpx;
box-sizing: border-box;
font-weight: 400;
}
.order-submission .wrapper .item .placeholder {
@@ -1209,7 +1182,7 @@
.order-submission .wrapper .item .list .payItem {
border: 1px solid #eee;
border-radius: 6rpx;
border-radius: 14rpx;
height: 86rpx;
width: 100%;
box-sizing: border-box;
@@ -1220,7 +1193,7 @@
.order-submission .wrapper .item .list .payItem.on {
border-color: #fc5445;
color: #e93323;
color: $theme-color;
}
.order-submission .wrapper .item .list .payItem .name {
@@ -1253,7 +1226,7 @@
}
.order-submission .moneyList {
margin-top: 12rpx;
margin-top: 15rpx;
background-color: #fff;
padding: 30rpx;
}
@@ -1268,7 +1241,7 @@
}
.order-submission .moneyList .item .money {
color: #868686;
color: #666666;
}
.order-submission .footer {
@@ -1289,7 +1262,7 @@
color: #fff;
width: 240rpx;
height: 70rpx;
background-color: #e93323;
background-color: $theme-color;
border-radius: 50rpx;
text-align: center;
line-height: 70rpx;

View File

@@ -36,48 +36,56 @@
</view>
<view class='list'>
<view class='item' v-for="(item,index) in orderList" :key="index">
<view @click='goOrderDetails(item.storeOrder.orderId,item.storeOrder.unique)'>
<view @click='goOrderDetails(item.orderId)'>
<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.storeOrder.bargainId != 0">砍价</text>
<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.storeOrder.createTime}}</view>
<text class="sign cart-color acea-row row-center-wrapper" v-else-if="item.storeOrder.seckillId != 0">秒杀</text> -->
<view>{{item.createTime}}</view>
</view>
<view v-if="item.status?item.status.type == 0:0" class='font-color'>待付款</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 v-else-if="item.storeOrder.shippingType==2" class='font-color'>待核销</view> -->
</view>
<view class='item-info acea-row row-between row-top' v-for="(item,index) in item.cartInfo" :key="index">
<view class='item-info acea-row row-between row-top' v-for="(items,index) in item.orderInfoList" :key="index">
<view class='pictrue'>
<image :src='item.info.productInfo.image'></image>
<image :src='items.image'></image>
</view>
<view class='text acea-row row-between'>
<view class='name line2'>{{item.info.productInfo.storeName}}</view>
<view class='name line2'>{{items.storeName}}</view>
<view class='money'>
<view v-if="item.info.productInfo.attrInfo">{{item.info.productInfo.attrInfo.price}}</view>
<view v-else>{{item.info.productInfo.price}}</view>
<view>x{{item.info.cartNum}}</view>
<view>{{items.price}}</view>
<view>x{{items.cartNum}}</view>
</view>
</view>
</view>
<view class='totalPrice'>{{(item.cartInfo?item.cartInfo.length:0) || 0}}件商品总金额
<text class='money font-color'>{{item.storeOrder.payPrice}}</text>
<view class='totalPrice'>{{item.totalNum}}件商品总金额
<text class='money font-color'>{{item.payPrice}}</text>
</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.storeOrder.id)'>取消订单</view>
<view class='bnt bg-color' v-if="item.status?item.status.type == 0:0" @click='goPay(item.storeOrder.payPrice,item.storeOrder.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.storeOrder.orderId,item.storeOrder.unique)'>查看详情</view>
<view class='bnt bg-color' v-else-if="item.status?item.status.type == 2:0 && item.status.deliveryType" @click='goOrderDetails(item.storeOrder.orderId,item.storeOrder.unique)'>查看详情</view>
<view class='bnt bg-color' v-else-if="item.status?item.status.type == 3:0" @click='goOrderDetails(item.storeOrder.orderId,item.storeOrder.unique)'>去评价</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.storeOrder.orderId,item.storeOrder.unique)'>再次购买</view>
<view class='bnt cancelBnt' v-if="item.status?item.status.type == 4:0" @click='delOrder(item.storeOrder.id,index)'>删除订单</view>
<view class='bnt cancelBnt' v-if="!item.paid" @click='cancelOrder(index,item.id)'>取消订单</view>
<view class='bnt bg-color' v-if="!item.paid" @click='goPay(item.payPrice,item.orderId)'>立即付款</view>
<view class='bnt bg-color' v-else-if="item.status== 0 || item.status== 1 || item.status== 3" @click='goOrderDetails(item.orderId)'>查看详情</view>
<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">
@@ -93,7 +101,7 @@
</view>
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
<payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id" :totalPrice='totalPrice'></payment>
@@ -105,12 +113,8 @@
getOrderList,
orderData,
orderCancel,
orderDel,
orderPay
orderDel
} from '@/api/order.js';
import {
getUserInfo
} from '@/api/user.js';
import {
openOrderSubscribe
} from '@/utils/SubscribeMessage.js';
@@ -166,27 +170,24 @@
isShowAuth: false //是否隐藏授权
};
},
computed: mapGetters(['isLogin']),
computed: mapGetters(['isLogin', 'userInfo']),
onShow() {
if (this.isLogin) {
this.loadend = false;
this.page = 1;
this.$set(this, 'orderList', []);
this.getOrderData();
this.getOrderList();
this.getUserInfo();
this.payMode[1].number = this.userInfo.nowMoney;
this.$set(this, 'payMode', this.payMode);
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
methods: {
onLoadFun() {
this.getOrderData();
this.getOrderList();
this.getUserInfo();
},
// 授权关闭
authColse: function(e) {
@@ -202,17 +203,6 @@
let value = opt.value != undefined ? opt.value : null;
(action && this[action]) && this[action](value);
},
/**
* 获取用户信息
*
*/
getUserInfo: function() {
let that = this;
getUserInfo().then(res => {
that.payMode[1].number = res.data.nowMoney;
that.$set(that, 'payMode', that.payMode);
});
},
/**
* 关闭支付组件
*
@@ -269,7 +259,7 @@
* 打开支付组件
*
*/
goPay: function(pay_price, order_id) {
goPay(pay_price, order_id) {
this.$set(this, 'pay_close', true);
this.$set(this, 'pay_order_id', order_id);
this.$set(this, 'totalPrice', pay_price);
@@ -282,8 +272,7 @@
this.loadend = false;
this.page = 1;
this.$set(this, 'orderList', []);
this.pay_close = false;
this.pay_order_id = '';
this.$set(this, 'pay_close', false);
this.getOrderData();
this.getOrderList();
},
@@ -293,7 +282,6 @@
*/
pay_fail: function() {
this.pay_close = false;
this.pay_order_id = '';
},
/**
* 去订单详情
@@ -346,7 +334,7 @@
page: that.page,
limit: that.limit,
}).then(res => {
let list = res.data || [];
let list = res.data.list || [];
let loadend = list.length < that.limit;
that.orderList = that.$util.SplitArray(list, that.orderList);
that.$set(that, 'orderList', that.orderList);
@@ -389,7 +377,7 @@
<style scoped lang="scss">
.my-order .header {
height: 260rpx;
height: 250rpx;
padding: 0 30rpx;
}
@@ -424,20 +412,24 @@
background-color: #fff;
width: 690rpx;
height: 140rpx;
border-radius: 6rpx;
margin: -73rpx auto 0 auto;
border-radius: 14rpx;
margin: -60rpx auto 0 auto;
}
.my-order .nav .item {
text-align: center;
font-size: 26rpx;
color: #282828;
padding: 29rpx 0;
padding: 26rpx 0;
}
.my-order .nav .item.on {
// font-weight: bold;
// border-bottom: 5rpx solid #e93323;
/* #ifdef H5 || MP */
font-weight: bold;
border-bottom: 5rpx solid #e93323;
/* #endif */
border-bottom: 5rpx solid $theme-color;
}
.my-order .nav .item .num {
@@ -451,13 +443,13 @@
.my-order .list .item {
background-color: #fff;
border-radius: 6rpx;
border-radius: 14rpx;
margin-bottom: 14rpx;
}
.my-order .list .item .title {
height: 84rpx;
padding: 0 30rpx;
padding: 0 24rpx;
border-bottom: 1rpx solid #eee;
font-size: 28rpx;
color: #282828;
@@ -465,13 +457,14 @@
.my-order .list .item .title .sign {
font-size: 24rpx;
padding: 0 7rpx;
padding: 0 13rpx;
height: 36rpx;
margin-right: 15rpx;
border-radius: 18rpx;
}
.my-order .list .item .item-info {
padding: 0 30rpx;
padding: 0 24rpx;
margin-top: 22rpx;
}
@@ -483,18 +476,17 @@
.my-order .list .item .item-info .pictrue image {
width: 100%;
height: 100%;
border-radius: 6rpx;
border-radius: 14rpx;
}
.my-order .list .item .item-info .text {
width: 486rpx;
width: 500rpx;
font-size: 28rpx;
color: #999;
margin-top: 6rpx;
}
.my-order .list .item .item-info .text .name {
width: 306rpx;
width: 350rpx;
color: #282828;
}

View File

@@ -0,0 +1,43 @@
<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

@@ -2,74 +2,84 @@
<view>
<view class="promoter-list">
<view class='promoterHeader bg-color'>
<view class='headerCon acea-row row-between-wrapper'>
<view class='headerCon acea-row row-between'>
<view>
<view class='name'>推广人数</view>
<view><text class='num'>{{teamCount}}</text></view>
<view><text class='num'>{{peopleData.count}}</text></view>
</view>
<view class='iconfont icon-tuandui'></view>
</view>
</view>
<view class='nav acea-row row-around'>
<view :class="grade == 0 ? 'item on' : 'item'" @click='setType(0)'>一级({{total}})</view>
<view :class="grade == 1 ? 'item on' : 'item'" @click='setType(1)'>({{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 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>
<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}}</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="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 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>
<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>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
@@ -77,7 +87,8 @@
<script>
import {
spreadPeople
spreadPeople,
spreadPeoCount
} from '@/api/user.js';
import {
toLogin
@@ -85,12 +96,16 @@
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
@@ -98,9 +113,6 @@
},
data() {
return {
total: 0,
totalLevel: 0,
teamCount: 0,
page: 1,
limit: 20,
keyword: '',
@@ -109,7 +121,10 @@
sortKey: '',
grade: 0,
status: false,
loadingList: false,
recordList: [],
peopleData: {},
isShow: false,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
};
@@ -118,14 +133,9 @@
onLoad() {
if (this.isLogin) {
this.userSpreadNewList();
this.spreadPeoCount();
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
onShow: function() {
@@ -142,10 +152,10 @@
authColse: function(e) {
this.isShowAuth = e
},
setSort: function(sortKey,isAsc) {
setSort: function(sortKey, isAsc) {
let that = this;
that.isAsc = isAsc;
that.sort = sortKey+isAsc;
that.sort = sortKey + isAsc;
that.sortKey = sortKey;
that.page = 1;
that.limit = 20;
@@ -160,7 +170,7 @@
this.$set(this, 'recordList', []);
this.userSpreadNewList();
},
setType: function(grade) {
if (this.grade != grade) {
this.grade = grade;
@@ -170,10 +180,16 @@
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;
@@ -185,6 +201,7 @@
let grade = that.grade;
let recordList = that.recordList;
let recordListNew = [];
if (that.loadingList) return;
if (status == true) return;
spreadPeople({
page: page,
@@ -194,15 +211,14 @@
sortKey: sortKey,
isAsc: isAsc
}).then(res => {
let recordListData = res.data.spreadPeopleList?res.data.spreadPeopleList:[];
let recordListData = res.data.list ? res.data.list : [];
let len = recordListData.length;
recordListNew = recordList.concat(recordListData);
that.total = res.data.total;
that.totalLevel = res.data.totalLevel;
that.teamCount = res.data.count;
that.status = limit > len;
that.page = page + 1;
that.$set(that, 'recordList', recordListNew || []);
that.loadingList = false;
if(that.recordList.length===0) that.isShow = true;
});
}
},
@@ -220,23 +236,28 @@
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 #e93323;
color: #e93323;
border-bottom: 5rpx solid $theme-color;
color: $theme-color;
}
.promoter-list .search {
width: 100%;
background-color: #fff;
height: 86rpx;
padding-left: 30rpx;
height: 100rpx;
padding: 0 24rpx;
box-sizing: border-box;
border-bottom-left-radius: 14rpx;
border-bottom-right-radius: 14rpx;
}
.promoter-list .search .input {
width: 610rpx;
width: 592rpx;
height: 60rpx;
border-radius: 50rpx;
background-color: #f5f5f5;
@@ -265,15 +286,14 @@
}
.promoter-list .search .iconfont {
font-size: 45rpx;
font-size: 32rpx;
color: #515151;
width: 110rpx;
height: 60rpx;
line-height: 60rpx;
}
.promoter-list .list {
margin-top: 12rpx;
margin-top: 20rpx;
}
.promoter-list .list .sortNav {
@@ -282,6 +302,8 @@
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 {
@@ -300,14 +322,10 @@
background-color: #fff;
border-bottom: 1rpx solid #eee;
height: 152rpx;
padding: 0 30rpx 0 20rpx;
padding: 0 24rpx;
font-size: 24rpx;
color: #666;
}
.promoter-list .list .item .picTxt {
width: 440rpx;
}
.promoter-list .list .item .picTxt .pictrue {
width: 106rpx;
@@ -325,9 +343,10 @@
}
.promoter-list .list .item .picTxt .text {
width: 304rpx;
// width: 304rpx;
font-size: 24rpx;
color: #666;
margin-left: 14rpx;
}
.promoter-list .list .item .picTxt .text .name {
@@ -337,13 +356,12 @@
}
.promoter-list .list .item .right {
width: 240rpx;
text-align: right;
font-size: 22rpx;
color: #333;
}
.promoter-list .list .item .right .num{
.promoter-list .list .item .right .num {
margin-right: 7rpx;
}
</style>

View File

@@ -10,7 +10,7 @@
<view class='iconfont icon-2'></view>
</view>
</view>
<view class='list' v-if="recordList.length>0">
<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'>
@@ -19,7 +19,7 @@
</view>
<view class='listn'>
<block v-for="(child,indexn) in item.child" :key="indexn">
<view class='itenm'>
<view class='itenm borRadius14'>
<view class='top acea-row row-between-wrapper'>
<view class='pictxt acea-row row-between-wrapper'>
<view class='pictrue'>
@@ -46,7 +46,7 @@
</view>
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
@@ -92,13 +92,7 @@
if (this.isLogin) {
this.getRecordOrderList();
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
methods: {
@@ -160,7 +154,6 @@
<style scoped lang="scss">
.promoter-order .list .item .title {
height: 133rpx;
padding: 0 30rpx;
font-size: 26rpx;
color: #999;
}
@@ -176,12 +169,11 @@
}
.promoter-order .list .item .listn .itenm~.itenm {
margin-top: 12rpx;
margin-top: 20rpx;
}
.promoter-order .list .item .listn .itenm .top {
margin-left: 30rpx;
padding-right: 30rpx;
padding: 0 24rpx;
border-bottom: 1rpx solid #eee;
height: 100rpx;
}
@@ -215,7 +207,7 @@
}
.promoter-order .list .item .listn .itenm .bottom {
padding: 20rpx 30rpx;
padding: 20rpx 24rpx;
font-size: 28rpx;
color: #666;
line-height: 1.6;

View File

@@ -48,7 +48,7 @@
</view>
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
@@ -107,13 +107,7 @@
if (this.isLogin) {
this.getRanklist();
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
// onShow: function () {

View File

@@ -1,23 +1,25 @@
<template>
<view>
<form @submit="formSubmit" report-submit='true'>
<view class='addAddress'>
<view class='list'>
<view class='item acea-row row-between-wrapper'>
<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='请输入姓名' name='realName' :value="userAddress.realName" placeholder-class='placeholder'></input>
<input type='text' placeholder='请输入姓名' placeholder-style="color:#ccc;" name='realName' :value="userAddress.realName"
placeholder-class='placeholder'></input>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='name'>联系电话</view>
<input type='text' placeholder='请输入联系电话' name="phone" :value='userAddress.phone' placeholder-class='placeholder'></input>
<input type='text' placeholder='请输入联系电话' placeholder-style="color:#ccc;" name="phone" :value='userAddress.phone'
placeholder-class='placeholder'></input>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='name'>所在地区</view>
<view class="address">
<picker mode="multiSelector" @change="bindRegionChange" @columnchange="bindMultiPickerColumnChange" :value="valueRegion"
:range="multiArray">
<picker mode="multiSelector" @change="bindRegionChange"
@columnchange="bindMultiPickerColumnChange" :value="valueRegion" :range="multiArray">
<view class='acea-row'>
<view class="picker">{{region[0]}}{{region[1]}}{{region[2]}}</view>
<view class="picker line1">{{region[0]}}{{region[1]}}{{region[2]}}</view>
<view class='iconfont icon-dizhi font-color'></view>
</view>
</picker>
@@ -25,12 +27,14 @@
</view>
<view class='item acea-row row-between-wrapper'>
<view class='name'>详细地址</view>
<input type='text' placeholder='请填写具体地址' name='detail' placeholder-class='placeholder' :value='userAddress.detail'></input>
<input type='text' placeholder='请填写具体地址' placeholder-style="color:#ccc;" name='detail' placeholder-class='placeholder'
:value='userAddress.detail'></input>
</view>
</view>
<view class='default acea-row row-middle'>
<view class='default acea-row row-middle borRadius14'>
<checkbox-group @change='ChangeIsDefault'>
<checkbox :checked="userAddress.isDefault" />设置为默认地址</checkbox-group>
<checkbox :checked="userAddress.isDefault" />设置为默认地址
</checkbox-group>
</view>
<button class='keepBnt bg-color' form-type="submit">立即保存</button>
@@ -43,7 +47,7 @@
</view>
</form>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
@@ -102,26 +106,27 @@
};
},
computed: mapGetters(['isLogin']),
watch:{
isLogin:{
handler:function(newV,oldV){
if(newV){
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getUserAddress();
this.getCityList();
}
},
deep:true
deep: true
}
},
onLoad(options) {
if (this.isLogin) {
this.cartId = options.cartId || '';
this.pinkId = options.pinkId || 0;
this.couponId = options.couponId || 0;
this.preOrderNo = options.preOrderNo || 0;
// this.cartId = options.cartId || '';
// this.pinkId = options.pinkId || 0;
// this.couponId = options.couponId || 0;
this.id = options.id || 0;
this.secKill = options.secKill || false;
this.combination = options.combination || false;
this.bargain = options.bargain || false;
// this.secKill = options.secKill || false;
// this.combination = options.combination || false;
// this.bargain = options.bargain || false;
uni.setNavigationBarTitle({
title: options.id ? '修改地址' : '添加地址'
})
@@ -131,13 +136,7 @@
// this.initialize();
// }
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
methods: {
@@ -286,9 +285,23 @@
that.pinkId = '';
that.couponId = '';
uni.navigateTo({
url: '/pages/users/order_confirm/index?cartId=' + cartId + '&addressId=' + (that.id ? that.id :
res.data
.id) + '&pinkId=' + pinkId + '&couponId=' + couponId + '&secKill=' + that.secKill + '&combination=' + that.combination + '&bargain=' + that.bargain
url: '/pages/users/order_confirm/index?cartId=' +
cartId +
'&addressId=' + (
that.id ? that
.id :
res.data
.id) +
'&pinkId=' +
pinkId +
'&couponId=' +
couponId +
'&secKill=' + that
.secKill +
'&combination=' +
that.combination +
'&bargain=' + that
.bargain
});
} else {
uni.navigateBack({
@@ -307,9 +320,10 @@
});
},
fail: function(res) {
if (res.errMsg == 'chooseAddress:cancel') return that.$util.Tips({
title: '取消选择'
});
if (res.errMsg == 'chooseAddress:cancel') return that.$util
.Tips({
title: '取消选择'
});
},
})
},
@@ -361,13 +375,17 @@
that.pinkId = '';
that.couponId = '';
uni.navigateTo({
url: '/pages/users/order_confirm/index?cartId=' + cartId + '&addressId=' + (that.id ? that.id :
res.data
.id) + '&pinkId=' + pinkId + '&couponId=' + couponId + '&secKill=' + that.secKill + '&combination=' + that.combination + '&bargain=' + that.bargain
url: '/pages/users/order_confirm/index?cartId=' +
cartId + '&addressId=' + (that.id ? that.id :
res.data
.id) + '&pinkId=' + pinkId + '&couponId=' +
couponId + '&secKill=' + that.secKill +
'&combination=' + that.combination + '&bargain=' +
that.bargain
});
} else {
uni.navigateTo({
url:'/pages/users/user_address_list/index'
url: '/pages/users/user_address_list/index'
})
// history.back();
}
@@ -436,16 +454,12 @@
icon: 'success'
});
setTimeout(function() {
if (that.cartId) {
let cartId = that.cartId;
let pinkId = that.pinkId;
let couponId = that.couponId;
that.cartId = '';
that.pinkId = '';
that.couponId = '';
uni.navigateTo({
url: '/pages/users/order_confirm/index?cartId=' + cartId + '&addressId=' + (that.id ? that.id : res.data.id) +'&pinkId=' + pinkId + '&couponId=' + couponId + '&secKill=' + that.secKill + '&combination=' + that.combination + '&bargain=' + that.bargain
});
if (that.preOrderNo>0) {
uni.redirectTo({
url: '/pages/users/order_confirm/index?preOrderNo=' + that
.preOrderNo + '&addressId=' + (that.id ? that.id : res.data
.id)
})
} else {
// #ifdef H5
return history.back();
@@ -455,7 +469,29 @@
delta: 1,
})
// #endif
}
// if (that.cartId) {
// let cartId = that.cartId;
// let pinkId = that.pinkId;
// let couponId = that.couponId;
// that.cartId = '';
// that.pinkId = '';
// that.couponId = '';
// uni.navigateTo({
// url: '/pages/users/order_confirm/index?cartId=' + cartId + '&addressId=' + (that.id ? that.id : res.data.id) +'&pinkId=' + pinkId + '&couponId=' + couponId + '&secKill=' + that.secKill + '&combination=' + that.combination + '&bargain=' + that.bargain
// });
// } else {
// // #ifdef H5
// return history.back();
// // #endif
// // #ifndef H5
// return uni.navigateBack({
// delta: 1,
// })
// // #endif
// }
}, 1000);
}).catch(err => {
return that.$util.Tips({
@@ -471,40 +507,42 @@
</script>
<style scoped lang="scss">
.addAddress {
padding-top: 20rpx;
}
.addAddress .list {
background-color: #fff;
padding: 0 24rpx;
}
.addAddress .list .item {
padding: 30rpx;
border-top: 1rpx solid #eee;
height: 90rpx;
line-height: 90rpx;
}
.addAddress .list .item .name {
width: 195rpx;
// width: 195rpx;
font-size: 30rpx;
color: #333;
}
.addAddress .list .item .address {
// width: 412rpx;
flex: 1;
margin-left: 20rpx;
margin-left: 50rpx;
}
.addAddress .list .item input {
width: 475rpx;
font-size: 30rpx;
font-weight: 400;
}
.addAddress .list .item .placeholder {
color: #ccc;
}
.addAddress .list .item picker {
width: 475rpx;
}
.addAddress .list .item picker .picker {
width: 410rpx;
font-size: 30rpx;
@@ -531,7 +569,7 @@
border-radius: 50rpx;
text-align: center;
line-height: 86rpx;
margin: 50rpx auto;
margin: 80rpx auto 24rpx auto;
font-size: 32rpx;
color: #fff;
}
@@ -544,7 +582,7 @@
line-height: 86rpx;
margin: 0 auto;
font-size: 32rpx;
color: #fe960f;
border: 1px solid #fe960f;
color: #E93323 ;
border: 1px solid #E93323;
}
</style>

View File

@@ -1,11 +1,11 @@
<template>
<view>
<view class='line'>
<image src='../../../static/images/line.jpg' v-if="addressList.length"></image>
</view>
<view class='address-management' :class='addressList.length < 1 && page > 1 ? "fff":""'>
<view class='line'>
<image src='../../../static/images/line.jpg' v-if="addressList.length"></image>
</view>
<radio-group class="radio-group" @change="radioChange" v-if="addressList.length">
<view class='item' v-for="(item,index) in addressList" :key="index">
<view class='item borRadius14' v-for="(item,index) in addressList" :key="index">
<view class='address' @click='goOrder(item.id)'>
<view class='consignee'>收货人{{item.realName}}<text class='phone'>{{item.phone}}</text></view>
<view>收货地址{{item.province}}{{item.city}}{{item.district}}{{item.detail}}</view>
@@ -37,22 +37,19 @@
</view>
</view>
<view style='height:120rpx;'></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>
<!-- #endif -->
<!-- #ifdef H5-->
<view class='addressBnt bg-color' :class="this.$wechat.isWeixin()?'':'on'" @click='addAddress'><text class='iconfont icon-tianjiadizhi'></text>添加新地址</view>
<view class='addressBnt wxbnt' @click='getAddress' v-if="this.$wechat.isWeixin()"><text class='iconfont icon-weixin2'></text>导入微信地址</view>
<!-- #endif -->
</view>
</view>
<view class='footer acea-row row-between-wrapper'>
<!-- #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>
<!-- #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>
<!-- #endif -->
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
@@ -114,21 +111,15 @@
},
onLoad(options) {
if (this.isLogin) {
this.cartId = options.cartId || '';
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.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 {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
onShow: function() {
@@ -353,23 +344,13 @@
this.pinkId = '';
this.couponId = '';
uni.navigateTo({
url: '/pages/users/user_address/index?cartId=' + cartId + '&pinkId=' + pinkId + '&couponId=' + couponId + '&secKill=' + this.secKill + '&combination=' + this.combination + '&bargain=' + this.bargain
url: '/pages/users/user_address/index?preOrderNo=' + this.preOrderNo
})
},
goOrder: function(id) {
let cartId = '';
let pinkId = '';
let couponId = '';
if (this.cartId && id) {
cartId = this.cartId;
pinkId = this.pinkId;
couponId = this.couponId;
this.cartId = '';
this.pinkId = '';
this.couponId = '';
if(this.preOrderNo){
uni.redirectTo({
url: '/pages/users/order_confirm/index?is_address=1&cartId=' + cartId + '&addressId=' + id + '&pinkId=' +
pinkId + '&couponId=' + couponId + '&secKill=' + this.secKill + '&combination=' + this.combination + '&bargain=' + this.bargain
url: '/pages/users/order_confirm/index?is_address=1&preOrderNo=' + this.preOrderNo + '&addressId=' + id
})
}
}
@@ -380,31 +361,32 @@
}
</script>
<style>
<style lang="scss" scoped>
.address-management{
padding: 20rpx 30rpx;
}
.address-management.fff {
background-color: #fff;
height: 1300rpx
}
.address-management .line {
.line {
width: 100%;
height: 3rpx;
image {
width: 100%;
height: 100%;
display: block;
}
}
.address-management .line image {
width: 100%;
height: 100%;
display: block;
}
.address-management .item {
background-color: #fff;
padding: 0 30rpx;
margin-bottom: 12rpx;
padding: 0 20rpx;
margin-bottom: 20rpx;
}
.address-management .item .address {
padding: 30rpx 0;
padding: 35rpx 0;
border-bottom: 1rpx solid #eee;
font-size: 28rpx;
color: #282828;
@@ -438,11 +420,11 @@
}
.address-management .item .operation .iconfont.icon-shanchu {
margin-left: 40rpx;
margin-left: 35rpx;
font-size: 38rpx;
}
.address-management .footer {
.footer {
position: fixed;
width: 100%;
background-color: #fff;
@@ -452,7 +434,7 @@
box-sizing: border-box;
}
.address-management .footer .addressBnt {
.footer .addressBnt {
width: 330rpx;
height: 76rpx;
border-radius: 50rpx;
@@ -462,18 +444,18 @@
color: #fff;
}
.address-management .footer .addressBnt.on {
.footer .addressBnt.on {
width: 690rpx;
margin: 0 auto;
}
.address-management .footer .addressBnt .iconfont {
.footer .addressBnt .iconfont {
font-size: 35rpx;
margin-right: 8rpx;
vertical-align: -1rpx;
}
.address-management .footer .addressBnt.wxbnt {
.footer .addressBnt.wxbnt {
background-color: #fe960f;
}
</style>

View File

@@ -3,14 +3,14 @@
<view class='bill-details'>
<view class='nav acea-row'>
<view class='item' :class='type==="all" ? "on":""' @click='changeType("all")'>全部</view>
<view class='item' :class='type==="expenditure" ? "on":""' @click='changeType("expenditure")'>支出</view>
<view class='item' :class='type==="income" ? "on":""' @click='changeType("income")'>收入</view>
<view class='item' :class='type==="expenditure" ? "on":""' @click='changeType("expenditure")'>消费</view>
<view class='item' :class='type==="income" ? "on":""' @click='changeType("income")'>充值</view>
</view>
<view class='sign-record'>
<view class='list' v-for="(item,index) in userBillList" :key="index">
<view class='list pad30' v-for="(item,index) in userBillList" :key="index">
<view class='item'>
<view class='data'>{{item.date}}</view>
<view class='listn'>
<view class='listn borRadius14'>
<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>
@@ -31,7 +31,7 @@
</view>
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
@@ -78,13 +78,7 @@
if (this.isLogin) {
this.getUserBillList();
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
/**
@@ -154,6 +148,9 @@
</script>
<style scoped lang='scss'>
.sign-record{
}
.bill-details .nav {
background-color: #fff;
height: 90rpx;
@@ -169,7 +166,7 @@
}
.bill-details .nav .item.on {
color: #e93323;
border-bottom: 3rpx solid #e93323;
color: $theme-color;
border-bottom: 3rpx solid $theme-color;
}
</style>

View File

@@ -108,7 +108,7 @@
</view>
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
@@ -117,8 +117,7 @@
import {
extractCash,
extractBank,
getUserInfo,
brokerageCommission
extractUser
} from '@/api/user.js';
import {
toLogin
@@ -169,8 +168,8 @@
isLogin:{
handler:function(newV,oldV){
if(newV){
this.getUserInfo();
this.getUserExtractBank();
this.getExtractUser();
}
},
deep:true
@@ -178,17 +177,10 @@
},
onLoad() {
if (this.isLogin) {
this.getUserInfo();
this.getUserExtractBank();
//this.getBrokerageCommission();
this.getExtractUser();
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
methods: {
@@ -218,13 +210,12 @@
this.qrcodeUrlZ = "";
},
onLoadFun: function() {
this.getUserInfo();
this.getUserExtractBank();
// this.getBrokerageCommission();
},
getBrokerageCommission: function(){
brokerageCommission().then(res=>{
getExtractUser(){
extractUser().then(res=>{
this.commission = res.data;
this.minPrice = res.data.minPrice;
})
},
// 授权关闭
@@ -234,20 +225,9 @@
getUserExtractBank: function() {
let that = this;
extractBank().then(res => {
let array = res.data.extractBank;
let array = res.data;
array.unshift("请选择银行");
that.$set(that, 'array', array);
that.minPrice = res.data.minPrice;
that.commission = res.data;
});
},
/**
* 获取个人用户信息
*/
getUserInfo: function() {
let that = this;
getUserInfo().then(res => {
that.userInfo = res.data;
});
},
swichNav: function(current) {
@@ -256,6 +236,15 @@
bindPickerChange: function(e) {
this.index = e.detail.value;
},
moneyInput(e) {
//正则表达试
e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
//重新赋值给input
this.$nextTick(() => {
this.money= e.target.value
})
},
subCash: function(e) {
let that = this,
value = e.detail.value;
@@ -289,13 +278,15 @@
if (value.money.length == 0) return this.$util.Tips({
title: '请填写提现金额'
});
if (!(/^(\d?)+(\.\d{0,2})?$/.test(value.money))) return this.$util.Tips({
title: '提现金额保留2位小数'
});
if (value.money < that.minPrice) return this.$util.Tips({
title: '提现金额不能低于' + that.minPrice
});
if(this.isCommitted==false){
this.isCommitted=true;
extractCash(value).then(res => {
that.getUserInfo();
return this.$util.Tips({
title: "提现成功",
icon: 'success'
@@ -337,7 +328,7 @@
width: 40rpx;
height: 40rpx;
border-radius: 50%;
border: 2rpx solid #e93323;
border: 2rpx solid $theme-color;
text-align: center;
line-height: 37rpx;
margin: 0 auto 6rpx auto;
@@ -346,9 +337,9 @@
}
.cash-withdrawal .nav .item .iconfont.on {
background-color: #e93323;
background-color: $theme-color;
color: #fff;
border-color: #e93323;
border-color: $theme-color;
}
.cash-withdrawal .nav .item .line {

View File

@@ -1,5 +1,9 @@
<template>
<view>
<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' : ''">
@@ -20,13 +24,16 @@
</view>
</view>
</view>
<view class='noCommodity' v-if="!couponsList.length && loading==true">
<view class='loadingicon acea-row row-center-wrapper' v-if="couponsList.length">
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view>
<view class='noCommodity' v-if="!couponsList.length">
<view class='pictrue'>
<image src='../../../static/images/noCoupon.png'></image>
</view>
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
@@ -68,6 +75,11 @@
return {
couponsList: [],
loading: false,
loadend: false,
loadTitle: '加载更多',//提示语
page: 1,
limit: 20,
navOn: 'usable',
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
};
@@ -87,13 +99,7 @@
if (this.isLogin) {
this.getUseCoupons();
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
methods: {
@@ -107,21 +113,65 @@
authColse: function(e) {
this.isShowAuth = e
},
onNav: function(type) {
this.navOn = type;
this.couponsList = [];
this.page = 1;
this.loadend = false;
this.getUseCoupons();
},
/**
* 获取领取优惠券列表
*/
getUseCoupons: function() {
let that = this;
getUserCoupons({status:0}).then(res => {
that.loading = true;
that.$set(that, 'couponsList', res.data || []);
})
if(this.loadend) return false;
if(this.loading) return false;
getUserCoupons({ page: that.page, limit: that.limit, type: that.navOn}).then(res => {
let list= res.data ? 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;
}).catch(err=>{
that.loading = false;
that.loadTitle = '加载更多';
});
}
}
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.getUseCoupons();
}
}
</script>
<style>
<style lang="scss" scoped>
.navbar {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 106rpx;
background-color: #FFFFFF;
z-index: 9;
.item {
border-top: 5rpx solid transparent;
border-bottom: 5rpx solid transparent;
font-size: 30rpx;
color: #999999;
&.on {
border-bottom-color: #E93323;
color: #282828;
}
}
}
.money {
display: flex;
flex-direction: column;
@@ -132,6 +182,9 @@
color: #ffffff;
font-size: 24rpx;
}
.coupon-list {
margin-top: 122rpx;
}
.coupon-list .item .text{
height: 100%;
}
@@ -154,4 +207,7 @@
color: #e83323;
margin-right: 12rpx;
}
.noCommodity {
margin-top: 300rpx;
}
</style>

View File

@@ -1,5 +1,12 @@
<template>
<view>
<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>
</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" : "" '>
@@ -8,30 +15,35 @@
</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":""'
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>
</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>
</view>
</view>
</view>
<view class='loadingicon acea-row row-center-wrapper' v-if="couponsList.length">
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view>
<view class='noCommodity' v-else-if="!couponsList.length && loading==true">
<view class='loadingicon acea-row row-center-wrapper'>
<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>
</view>
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
@@ -44,126 +56,186 @@
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 //是否隐藏授权
};
},
computed: mapGetters(['isLogin']),
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getUseCoupons();
}
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
},
deep: true
}
},
onLoad(){
if(this.isLogin){
this.getUseCoupons();
}else{
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.getUseCoupons();
},
methods: {
onLoadFun(){
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();
}
},
// 授权关闭
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(this.loadend) return false;
if(this.loading) return false;
getCoupons({ page: that.page, limit: that.limit }).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;
}).catch(err=>{
that.loading = false;
that.loadTitle = '加载更多';
});
}
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();
}
}
}
}
</script>
<style scoped>
.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;
.nav {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 106rpx;
background-color: #FFFFFF;
font-size: 30rpx;
color: #999999;
z-index: 9;
}
.condition .line-title.gray{
border-color:#BBB;
color:#bbb;
background-color:#F5F5F5;
.nav .acea-row {
border-top: 5rpx solid transparent;
border-bottom: 5rpx solid transparent;
cursor: pointer;
}
.coupon-list .pic-num{
color: #FFFFFF;
font-size: 24rpx;
.nav .acea-row.on {
border-bottom-color: #E93323;
color: #E93323;
}
.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.gray {
border-color: #BBB;
color: #bbb;
background-color: #F5F5F5;
}
.coupon-list .pic-num {
color: #FFFFFF;
font-size: 24rpx;
}
</style>

View File

@@ -1,22 +1,48 @@
<template>
<view>
<view class="hdbj"></view>
<view class='collectionGoods' v-if="collectProductList.length">
<navigator :url='"/pages/goods_details/index?id="+item.id' hover-class='none' class='item acea-row row-between-wrapper'
v-for="(item,index) in collectProductList" :key="index">
<view class='pictrue'>
<image :src="item.image"></image>
<!-- #ifdef H5 || MP-->
<view class='nav acea-row row-between-wrapper'>
<view>当前共 <text class='num font-color'>{{ totals }}</text>件商品</view>
<view class='administrate acea-row row-center-wrapper' @click='manage'>{{ footerswitch ? '管理' : '取消'}}
</view>
<view class='text acea-row row-column-between'>
<view class='name line1'>{{item.storeName}}</view>
<view class='acea-row row-between-wrapper'>
<view class='money font-color'>{{item.price}}</view>
<view class='delete' @click.stop='delCollection(item.id,index)'>删除</view>
</view>
<!-- #endif -->
<view class="list">
<checkbox-group @change="checkboxChange" class="centent">
<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'
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>
</navigator>
</view>
</view>
</navigator>
</checkbox-group>
</view>
<view class='loadingicon acea-row row-center-wrapper'>
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view>
<view v-if="!footerswitch" class='footer acea-row row-between-wrapper'>
<view>
<checkbox-group @change="checkboxAllChange">
<checkbox value="all" :checked="!!isAllSelect" />
<text class='checkAll'>全选</text>
</checkbox-group>
</view>
<view class='button acea-row row-middle'>
<form @submit="delCollectionAll" report-submit='true'>
<button class='bnt cart-color' formType="submit">取消收藏</button>
</form>
</view>
</view>
</view>
<view class='noCommodity' v-else-if="!collectProductList.length && page > 1">
<view class='pictrue'>
@@ -25,7 +51,7 @@
<recommend :hostProduct="hostProduct"></recommend>
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
@@ -35,7 +61,7 @@
import {
getCollectUserList,
getProductHot,
collectDel
collectDelete
} from '@/api/store.js';
import {
mapGetters
@@ -58,6 +84,7 @@
},
data() {
return {
footerswitch: true,
hostProduct: [],
loadTitle: '加载更多',
loading: false,
@@ -66,10 +93,14 @@
limit: 8,
page: 1,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false ,//是否隐藏授权
hotScroll:false,
hotPage:1,
hotLimit:10
isShowAuth: false, //是否隐藏授权
hotScroll: false,
hotPage: 1,
hotLimit: 10,
isAllSelect: false, //全选
selectValue: [], //选中的数据
delBtnWidth: 80, //左滑默认宽度
totals: 0
};
},
computed: mapGetters(['isLogin']),
@@ -79,30 +110,88 @@
this.page = 1;
this.collectProductList = [];
this.get_user_collect_product();
this.get_host_product();
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
onShow(){
onShow() {
this.loadend = false;
this.page = 1;
this.collectProductList = [];
this.get_user_collect_product();
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
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;
},
checkboxChange: function(event) {
var items = this.collectProductList,
values = event.detail.value;
for (var i = 0, lenI = items.length; i < lenI; ++i) {
const item = items[i]
if (values.includes(item.id.toString())) {
this.$set(item, 'checked', true)
} else {
this.$set(item, 'checked', false)
}
}
this.selectValue = values.toString();
this.isAllSelect = items.length === values.length;
},
checkboxAllChange: function(event) {
let value = event.detail.value;
if (value.length > 0) {
this.setAllSelectValue(1)
} else {
this.setAllSelectValue(0)
}
},
setAllSelectValue: function(status) {
let selectValue = [];
if (this.collectProductList.length > 0) {
this.collectProductList.map(item => {
if (status) {
this.$set(item, 'checked', true)
selectValue.push(item.id);
this.isAllSelect = true;
} else {
this.$set(item, 'checked', false)
this.isAllSelect = false;
}
});
this.selectValue = selectValue.toString();
}
},
/**
* 授权回调
*/
@@ -127,10 +216,16 @@
page: that.page,
limit: that.limit
}).then(res => {
res.data.list.map(item => {
that.$set(item, 'right', 0);
});
that.totals = res.data.total;
let collectProductList = res.data.list;
let loadend = collectProductList.length < that.limit;
that.collectProductList = that.$util.SplitArray(collectProductList, that.collectProductList);
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.page = that.page + 1;
@@ -144,15 +239,34 @@
* 取消收藏
*/
delCollection: function(id, index) {
let that = this;
collectDel(id).then(res => {
return that.$util.Tips({
this.selectValue = id;
this.del({
ids: this.selectValue.toString()
});
},
delCollectionAll: function() {
if (!this.selectValue || this.selectValue.length == 0) return this.$util.Tips({
title: '请选择商品'
});
this.del({
ids: this.selectValue
});
},
del: function(data) {
collectDelete(data).then(res => {
this.$util.Tips({
title: '取消收藏成功',
icon: 'success'
}, function() {
that.collectProductList.splice(index, 1);
that.$set(that, 'collectProductList', that.collectProductList);
});
// this.collectProductList = this.collectProductList.filter(item=>item!==this.selectValue)
this.collectProductList = [];
this.loadend = false;
this.page = 1;
this.get_user_collect_product();
}).catch(err => {
return this.$util.Tips({
title: err
})
});
},
/**
@@ -160,45 +274,118 @@
*/
get_host_product: function() {
let that = this;
if(that.hotScroll) return
if (that.hotScroll) return
getProductHot(
that.hotPage,
that.hotLimit,
).then(res => {
that.hotPage++
that.hotScroll = res.data.list.length<that.hotLimit
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();
}
}
</script>
<style scoped lang="scss">
.hdbj {
width: 100%;
height: 30rpx;
background-color: #f5f5f5;
z-index: 999999;
position: fixed;
top: 0;
}
.order-item {
width: 100%;
display: flex;
position: relative;
align-items: right;
flex-direction: row;
}
.remove {
width: 120rpx;
height: 100%;
background-color: $theme-color;
color: white;
position: absolute;
top: 0;
right: -160rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 24rpx;
}
.collectionGoods {
background-color: #fff;
border-top: 1rpx solid #eee;
.nav {
width: 92%;
height: 90rpx;
background-color: #fff;
padding: 0 24rpx;
-webkit-box-sizing: border-box;
box-sizing: border-box;
font-size: 28rpx;
color: #282828;
position: fixed;
left: 30rpx;
z-index: 5;
top: 30rpx;
border-bottom: 1px solid #EEEEEE;
border-top-left-radius: 14rpx;
border-top-right-radius: 14rpx;
}
.list {
padding: 30rpx;
margin-top: 90rpx;
.name {
width: 434rpx;
margin-bottom: 56rpx;
}
}
.centent {
/* #ifdef H5 || MP */
background-color: #fff;
/* #endif */
border-bottom-left-radius: 14rpx;
border-bottom-right-radius: 14rpx;
}
}
.collectionGoods .item {
margin-left: 30rpx;
padding-right: 30rpx;
border-bottom: 1rpx solid #eee;
background-color: #fff;
padding-left: 24rpx;
height: 180rpx;
margin-bottom: 15rpx;
border-radius: 14rpx;
}
.collectionGoods .item .pictrue {
width: 130rpx;
height: 130rpx;
margin-right: 20rpx;
}
.collectionGoods .item .pictrue image {
width: 100%;
height: 100%;
border-radius: 6rpx;
border-radius: 14rpx;
}
.collectionGoods .item .text {
@@ -232,4 +419,40 @@
padding-top: 1rpx;
border-top: 0;
}
.footer {
z-index: 9;
width: 100%;
height: 96rpx;
background-color: #fff;
position: fixed;
padding: 0 30rpx;
box-sizing: border-box;
border-top: 1rpx solid #eee;
border-bottom: 1px solid #EEEEEE;
/* #ifdef H5 || MP */
bottom: 0rpx;
/* #endif */
/* #ifndef MP */
// bottom: 98rpx;
// bottom: calc(98rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
// bottom: calc(98rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
/* #endif */
.checkAll {
font-size: 28rpx;
color: #282828;
margin-left: 16rpx;
}
.button .bnt {
font-size: 28rpx;
color: #999;
border-radius: 30rpx;
border: 1px solid #999;
width: 160rpx;
height: 60rpx;
text-align: center;
line-height: 60rpx;
}
}
</style>

View File

@@ -1,39 +1,45 @@
<template>
<view>
<form @submit="formSubmit" report-submit='true'>
<view class='personal-data'>
<view class='list'>
<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='userInfo.localPath'></image>
<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 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/user_phone/index" hover-class="none" class="input">
<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>
<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="!userInfo.phone">
<!-- <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='userInfo.phone' class='id'></input>
<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='userInfo.uid' disabled='true' class='id'></input>
<input type='text' :value='uid' disabled='true' class='id'></input>
<text class='iconfont icon-suozi'></text>
</view>
</view>
@@ -45,7 +51,7 @@
</view>
</view>
<!-- #endif -->
<view class="item acea-row row-between-wrapper" v-if="userInfo.phone && userInfo.userType == 'h5'">
<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>
@@ -54,19 +60,19 @@
</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>
<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>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
<script>
import {
getUserInfo,
userEdit,
getLogout
} from '@/api/user.js';
@@ -91,44 +97,21 @@
},
data() {
return {
userInfo: {},
memberInfo: {},
loginType: 'h5', //app.globalData.loginType
userIndex: 0,
newAvatar: '',
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
};
},
computed: mapGetters(['isLogin']),
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getUserInfo();
}
},
deep: true
}
},
computed: mapGetters(['isLogin', 'uid', 'userInfo']),
onLoad() {
if (this.isLogin) {
this.getUserInfo();
} else {
// #ifdef H5 || APP-PLUS
if (!this.isLogin) {
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
methods: {
/**
* 授权回调
*/
onLoadFun: function() {
this.getUserInfo();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
@@ -151,48 +134,40 @@
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.switchTab({
url: '/pages/index/index'
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);
});
})
.catch(err => {
console.log(err);
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
},
/**
* 获取用户详情
*/
getUserInfo: function() {
let that = this;
getUserInfo().then(res => {
res.data.localPath = res.data.avatar;
that.$set(that, 'userInfo', res.data);
that.$store.commit("UPDATE_USERINFO", res.data);
that.$store.commit("SETUID", res.data.uid);
});
},
/**
* 上传文件
*
*/
uploadpic: function() {
let that = this;
that.$util.uploadImageOne({url:'user/upload/image',name:'multipart', model:"user", pid:7}, function(res){
that.userInfo.avatar = res.data.url;
that.$set(that.userInfo,'localPath',res.data.localPath);
that.$util.uploadImageOne({
url: 'user/upload/image',
name: 'multipart',
model: "user",
pid: 7
}, function(res) {
that.newAvatar = res.data.url;
});
},
@@ -205,8 +180,12 @@
if (!value.nickname) return that.$util.Tips({
title: '用户姓名不能为空'
});
value.avatar = that.userInfo.avatar;
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'
@@ -214,8 +193,9 @@
tab: 3,
url: 1
});
}).catch(msg => {
return that.$util.Tips({
return that.$util.Tips({
title: msg || '保存失败,您并没有修改'
}, {
tab: 3,
@@ -249,11 +229,11 @@
padding: 0 30rpx;
position: relative;
border: 2rpx solid #f8f8f8;
box-sizing:border-box;
box-sizing: border-box;
}
.personal-data .wrapper .wrapList .item.on {
border-color: #e93323;
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%;
@@ -308,7 +288,7 @@
border-radius: 27rpx;
width: 140rpx;
height: 54rpx;
border: 2rpx solid #e93323;
border: 2rpx solid $theme-color;
}
.personal-data .wrapper .wrapList .item .currentBnt {
@@ -323,14 +303,13 @@
}
.personal-data .list {
margin-top: 15rpx;
margin-top: 30rpx;
background-color: #fff;
}
.personal-data .list .item {
padding: 30rpx 30rpx 30rpx 0;
border-bottom: 1rpx solid #f2f2f2;
margin-left: 30rpx;
padding: 24rpx;
font-size: 32rpx;
color: #282828;
}
@@ -355,8 +334,8 @@
height: 100%;
border-radius: 50%;
}
.personal-data .list .item .pictrue .alter{
.personal-data .list .item .pictrue .alter {
width: 30rpx;
height: 30rpx;
border-radius: 50%;

View File

@@ -3,20 +3,20 @@
<view class='integral-details'>
<view class='header'>
<view class='currentScore'>当前积分</view>
<view class="scoreNum">{{userInfo.integral||0}}</view>
<view class="scoreNum">{{integral.integral||0}}</view>
<view class='line'></view>
<view class='nav acea-row'>
<view class='item'>
<view class='num'>{{userInfo.sumIntegral||0}}</view>
<view class='num'>{{integral.sumIntegral||0}}</view>
<view>累计积分</view>
</view>
<view class='item'>
<view class='num'>{{userInfo.deductionIntegral||0}}</view>
<view class='num'>{{integral.deductionIntegral||0}}</view>
<view>累计消费</view>
</view>
<view class='item'>
<view class='num'>{{userInfo.yesterdayIntegral||0}}</view>
<view>今日获得</view>
<view class='num'>{{integral.frozenIntegral||0}}</view>
<view>冻结积分</view>
</view>
</view>
</view>
@@ -29,11 +29,11 @@
<view class='tip acea-row row-middle'><text class='iconfont icon-shuoming'></text>提示积分数值的高低会直接影响您的会员等级</view>
<view class='item acea-row row-between-wrapper' v-for="(item,index) in integralList" :key="index">
<view>
<view class='state'>{{item.mark}}</view>
<view>{{item.add_time}}</view>
<view class='state'>{{item.title}}</view>
<view>{{item.updateTime}}</view>
</view>
<view class='num font-color' v-if="item.pm">+{{item.number}}</view>
<view class='num' v-else>-{{item.number}}</view>
<view class='num font-color' v-if="item.type===1">+{{item.integral}}</view>
<view class='num' v-else>-{{item.integral}}</view>
</view>
<view class='loadingicon acea-row row-center-wrapper' v-if="integralList.length>0">
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
@@ -61,13 +61,13 @@
</view>
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
<script>
import { postSignUser, getIntegralList } from '@/api/user.js';
import { postIntegralUser, getIntegralList } from '@/api/user.js';
import {
toLogin
} from '@/libs/login.js';
@@ -100,7 +100,7 @@
page: 1,
limit: 10,
integralList: [],
userInfo:{},
integral:{},
loadend: false,
loading: false,
loadTitle: '加载更多',
@@ -125,13 +125,7 @@
this.getUserInfo();
this.getIntegralList();
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
/**
@@ -154,12 +148,8 @@
},
getUserInfo: function() {
let that = this;
postSignUser({
sign: 1,
integral: 1,
all: 1
}).then(function(res) {
that.$set(that,'userInfo',res.data);
postIntegralUser().then(function(res) {
that.$set(that,'integral',res.data);
});
},
@@ -266,7 +256,7 @@
.integral-details .wrapper .nav .item.on {
background-color: #fff;
color: #e93323;
color: $theme-color;
font-weight: bold;
border-radius: 20rpx 0 0 0;
}

View File

@@ -9,22 +9,22 @@
<view>总资产()</view>
<view class='money'>{{statistics.nowMoney || 0}}</view>
</view>
<!-- #ifdef APP-PLUS || H5 -->
<!-- #ifdef H5 -->
<navigator url="/pages/users/user_payment/index" hover-class="none" class='recharge font-color'>充值</navigator>
<!-- #endif -->
<!-- #ifdef MP -->
<view v-if="rechargeSwitch" @click="openSubscribe('/pages/users/user_payment/index')" class='recharge font-color'>充值</view>
<view v-if="userInfo.rechargeSwitch" @click="openSubscribe('/pages/users/user_payment/index')" class='recharge font-color'>充值</view>
<!-- #endif -->
</view>
<view class='cumulative acea-row row-top'>
<!-- #ifdef APP-PLUS || H5 -->
<!-- #ifdef H5 -->
<view class='item'>
<view>累计充值()</view>
<view class='money'>{{statistics.recharge || 0}}</view>
</view>
<!-- #endif -->
<!-- #ifdef MP -->
<view class='item' v-if="rechargeSwitch">
<view class='item' v-if="userInfo.rechargeSwitch">
<view>累计充值()</view>
<view class='money'>{{statistics.recharge || 0}}</view>
</view>
@@ -49,7 +49,7 @@
</view>
<view>消费记录</view>
</navigator>
<navigator class='item' hover-class='none' url='/pages/users/user_bill/index?type=income' v-if="rechargeSwitch">
<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>
</view>
@@ -121,7 +121,7 @@
<recommend :hostProduct="hostProduct" v-if="hostProduct.length"></recommend>
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
@@ -135,7 +135,6 @@
openRechargeSubscribe
} from '@/utils/SubscribeMessage.js';
import {
getUserInfo,
userActivity,
getuserDalance
} from '@/api/user.js';
@@ -160,10 +159,8 @@
},
data() {
return {
userInfo: {},
hostProduct: [],
isClose: false,
rechargeSwitch: false,
activity: {},
isAuto: false, //没有授权的不会自动授权
isShowAuth: false ,//是否隐藏授权
@@ -173,12 +170,11 @@
hotLimit:10
};
},
computed: mapGetters(['isLogin']),
computed: mapGetters(['isLogin', 'userInfo']),
watch:{
isLogin:{
handler:function(newV,oldV){
if(newV){
this.getUserInfo();
this.get_host_product();
this.get_activity();
this.userDalance();
@@ -189,23 +185,15 @@
},
onLoad() {
if (this.isLogin) {
this.getUserInfo();
this.get_host_product();
this.get_activity();
this.userDalance();
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
methods: {
onLoadFun: function() {
this.getUserInfo();
this.get_host_product();
this.get_activity();
this.userDalance();
@@ -234,16 +222,6 @@
});
},
// #endif
/**
* 获取用户详情
*/
getUserInfo: function() {
let that = this;
getUserInfo().then(res => {
that.$set(that, 'userInfo', res.data);
that.rechargeSwitch = res.data.rechargeSwitch;
});
},
/**
* 获取活动可参与否
*/
@@ -278,7 +256,7 @@
<style scoped lang="scss">
.my-account .wrapper {
background-color: #fff;
padding: 32rpx 0 34rpx 0;
padding: 32rpx 0 15rpx 0;
margin-bottom: 14rpx;
}

View File

@@ -4,7 +4,7 @@
<view class="payment-top acea-row row-column row-center-wrapper">
<span class="name">我的余额</span>
<view class="pic">
<span class="pic-font">{{ userinfo.nowMoney || 0 }}</span>
<span class="pic-font">{{ userInfo.nowMoney || 0 }}</span>
</view>
</view>
<view class="payment">
@@ -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" class="pic-box-money pic-number-pic" :class="parseFloat(activePic) === parseFloat(picList.length) ? 'pic-box-color-active' : ''" />
<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' : ''" />
</view>
<view class="tips-box">
<view class="tips mt-30">注意事项</view>
@@ -34,7 +34,7 @@
name="number"></input></view>
<view class="tips-title">
<view style="font-weight: bold; font-size: 26rpx;">提示</view>
<view style="margin-top: 10rpx;">当前佣金为 <text class='font-color'>{{commission || 0}}</text></view>
<view style="margin-top: 10rpx;">当前佣金为 <text class='font-color'>{{userInfo.brokeragePrice || 0}}</text></view>
</view>
<view class="tips-box">
<view class="tips mt-30">注意事项</view>
@@ -43,11 +43,11 @@
</view>
</view>
</view>
<button class='but bg-color' formType="submit"> {{active ? '立即转入': '立即充值' }}</button>
<button class='but' formType="submit"> {{active ? '立即转入': '立即充值' }}</button>
</view>
</form>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
@@ -55,12 +55,11 @@
<script>
import {
getUserInfo,
rechargeRoutine,
rechargeWechat,
getRechargeApi,
extractBank,
transferIn
transferIn,
appWechat
} from '@/api/user.js';
import { wechatQueryPayResult } from '@/api/order.js';
import {
@@ -87,7 +86,6 @@
navRecharge: ['账户充值', '佣金转入'],
active: 0,
number: '',
userinfo: {},
placeholder: "0.00",
from: '',
isAuto: false, //没有授权的不会自动授权
@@ -97,18 +95,15 @@
money: "",
numberPic: '',
rechar_id: 0,
rechargeAttention: [],
commission: 0
rechargeAttention: []
};
},
computed: mapGetters(['isLogin']),
computed: mapGetters(['isLogin', 'systemPlatform','userInfo']),
watch:{
isLogin:{
handler:function(newV,oldV){
if(newV){
this.getUserInfo();
this.getRecharge();
this.getUserExtractBank();
}
},
deep:true
@@ -116,20 +111,12 @@
},
onLoad(options) {
// #ifdef H5
this.from = this.$wechat.isWeixin() ? "public" : "weixinh5"
this.from = this.$wechat.isWeixin() ? "public" : "weixinh5";
// #endif
if (this.isLogin) {
this.getUserInfo();
this.getRecharge();
this.getUserExtractBank();
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
methods: {
@@ -149,12 +136,6 @@
}
},
getUserExtractBank: function() {
let that = this;
extractBank().then(res => {
that.commission = res.data.commissionCount;
});
},
/**
* 充值额度选择
@@ -178,9 +159,7 @@
onLoadFun: function() {
this.getUserInfo();
this.getRecharge();
this.getUserExtractBank();
},
// 授权关闭
authColse: function(e) {
@@ -189,15 +168,6 @@
navRecharges: function(index) {
this.active = index;
},
/**
* 获取用户信息
*/
getUserInfo: function() {
let that = this;
getUserInfo().then(res => {
that.$set(that, 'userinfo', res.data);
})
},
/*
* 用户充值
*/
@@ -219,6 +189,10 @@
transferIn({
price: parseFloat(value)
}).then(res => {
that.$store.commit("changInfo", {
amount1: 'brokeragePrice',
amount2: that.$util.$h.Sub(that.userInfo.brokeragePrice, parseFloat(value))
});
return that.$util.Tips({
title: '转入成功',
icon: 'success'
@@ -254,10 +228,15 @@
title: '充值金额不能为0'
});
}
if (money > 50000) {
return that.$util.Tips({
title: '充值金额最大值为50000'
});
}
} else {
money = this.numberPic
}
// #ifdef MP || APP-PLUS
// #ifdef MP
rechargeRoutine({
price: money,
type: 0,
@@ -272,7 +251,11 @@
signType: jsConfig.signType,
paySign: jsConfig.paySign,
success: function(res) {
that.$set(that, 'userinfo.nowMoney', that.$util.$h.Add(value, that.userinfo.nowMoney));
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'
@@ -333,10 +316,12 @@
} else {
that.$wechat.pay(data)
.finally(() => {
that.$set(that, 'userinfo.nowMoney', that.$util.$h.Add(value, that.userinfo.nowMoney));
wechatQueryPayResult({
orderNo: orderNo
}).then(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));
wechatQueryPayResult(orderNo).then(res => {
return that.$util.Tips({
title: '支付成功',
icon: 'success'
@@ -383,8 +368,8 @@
background-color: #fff;
border-radius: 10rpx;
padding-top: 25rpx;
border-top-right-radius: 39rpx;
border-top-left-radius: 39rpx;
border-top-right-radius: 14rpx;
border-top-left-radius: 14rpx;
}
.payment .nav {
@@ -446,8 +431,9 @@
font-size: 30rpx;
width: 700rpx;
height: 86rpx;
border-radius: 50rpx;
margin: 46rpx auto 0 auto;
border-radius: 43rpx;
margin: 50rpx auto 0 auto;
background: linear-gradient(90deg, #FF7931 0%, #F11B09 100%);
line-height: 86rpx;
}
@@ -537,4 +523,4 @@
font-size: 24rpx;
color: #333;
}
</style>
</style>

View File

@@ -19,7 +19,7 @@
<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>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
@@ -71,13 +71,7 @@
// this.$set(this, 'key', res.data.key)
// });
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
methods: {
@@ -210,7 +204,27 @@
}
</script>
<style lang="scss">
<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;
}
@@ -249,7 +263,7 @@
.ChangePassword .list .item .code {
font-size: 32rpx;
background-color: #fff;
// background-color: #fff;
}
.ChangePassword .list .item .code.on {

View File

@@ -21,7 +21,7 @@
</form>
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
@@ -77,13 +77,7 @@
if (this.isLogin) {
this.getUserInfo();
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
methods: {

View File

@@ -1,32 +1,35 @@
<template>
<view>
<view class='return-list' v-if="orderList.length">
<view class='goodWrapper' v-for="(item,index) in orderList" :key="index" @click='goOrderDetails(item.storeOrder.orderId)'>
<view class='iconfont icon-tuikuanzhong powder' v-if="item.status.type==-1"></view>
<view class='iconfont icon-yituikuan' v-if="item.status.type==-2"></view>
<view class='orderNum'>订单号{{item.storeOrder.orderId}}</view>
<view class='item acea-row row-between-wrapper' v-for="(item,index) in item.cartInfo" :key="index">
<view class='return-list pad30' v-if="orderList.length">
<view class='goodWrapper borRadius14' v-for="(item,index) in orderList" :key="index" @click='goOrderDetails(item.orderId)'>
<view class='iconfont icon-tuikuanzhong powder' v-if="item.refundStatus==1 || item.refundStatus==3"></view>
<view class='iconfont icon-yituikuan' v-if="item.refundStatus==2"></view>
<view class='orderNum'>订单号{{item.orderId}}</view>
<view class='item acea-row row-between-wrapper' v-for="(items,index) in item.orderInfoList" :key="index">
<view class='pictrue'>
<image :src='item.info.productInfo.image'></image>
<image :src='items.image'></image>
</view>
<view class='text'>
<view class='acea-row row-between-wrapper'>
<view class='name line1'>{{item.info.productInfo.storeName}}</view>
<view class='num'>x {{item.info.cartNum}}</view>
<view class='name line1'>{{items.storeName}}</view>
<view class='num'>x {{items.cartNum}}</view>
</view>
<view class='attr line1' v-if="item.info.productInfo.attrInfo">{{item.info.productInfo.attrInfo.suk}}</view>
<view class='attr line1' v-else>{{item.info.productInfo.storeName}}</view>
<view class='money'>{{item.info.productInfo.price}}</view>
<view class='attr line1' v-if="items.suk">{{items.suk}}</view>
<view class='attr line1' v-else>{{items.storeName}}</view>
<view class='money'>{{items.price}}</view>
</view>
</view>
<view class='totalSum'>{{item.cartInfo.length || 0}}件商品总金额 <text class='font-color price'>{{item.storeOrder.payPrice}}</text></view>
<view class='totalSum'>{{item.totalNum || 0}}件商品总金额 <text class='font-color price'>{{item.payPrice}}</text></view>
</view>
</view>
<view class='loadingicon acea-row row-center-wrapper'>
<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">
<emptyPage title="暂无订单~"></emptyPage>
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
@@ -34,6 +37,7 @@
<script>
import home from '@/components/home';
import emptyPage from '@/components/emptyPage.vue'
import {
getOrderList
} from '@/api/order.js';
@@ -48,6 +52,7 @@
// #endif
export default {
components: {
emptyPage,
home,
// #ifdef MP
authorize
@@ -81,13 +86,7 @@
if (this.isLogin) {
this.getOrderList();
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
/**
@@ -130,7 +129,7 @@
page: that.page,
limit: that.limit,
}).then(res => {
let list = res.data || [];
let list = res.data.list || [];
let loadend = list.length < that.limit;
that.orderList = that.$util.SplitArray(list, that.orderList);
that.$set(that,'orderList',that.orderList);
@@ -150,17 +149,17 @@
<style lang="scss" scoped>
.return-list .goodWrapper {
background-color: #fff;
margin-top: 13rpx;
margin-top: 20rpx;
position: relative;
padding: 0rpx 24rpx;
}
.return-list .goodWrapper .orderNum {
padding: 0 30rpx;
border-bottom: 1px solid #eee;
height: 87rpx;
line-height: 87rpx;
font-size: 30rpx;
color: #282828;
color: #333333;
}
.return-list .goodWrapper .item {
@@ -183,7 +182,7 @@
position: absolute;
font-size: 109rpx;
top: 7rpx;
right: 30rpx;
right: 22rpx;
color: #ccc;
}

View File

@@ -12,7 +12,8 @@
<view class='integral acea-row'><text>积分: {{userInfo.integral}}</text></view>
</view>
</view>
<navigator class='right acea-row row-middle' hover-class='none' url='/pages/users/user_sgin_list/index'>
<navigator class='right acea-row row-middle' hover-class='none'
url='/pages/users/user_sgin_list/index'>
<view class='iconfont icon-caidan'></view>
<view>明细</view>
</navigator>
@@ -21,13 +22,18 @@
<view class='wrapper'>
<view class='list acea-row row-between-wrapper'>
<view class='item' v-for="(item,index) in signSystemList" :key="index">
<view :class="(index + 1 === signSystemList.length ? 'reward' : '') + ' ' +(sign_index >= index + 1 ? 'rewardTxt' : '')">{{item.title}}</view>
<view
:class="(index + 1 === signSystemList.length ? 'reward' : '') + ' ' +(sign_index >= index + 1 ? 'rewardTxt' : '')">
{{item.title}}
</view>
<!-- <view :class='(index+1) == signSystemList.length ? "rewardTxt" : ""'>{{item.title}}</view> -->
<view class='venus' :class="(index + 1 === signSystemList.length ? 'reward' : '') + ' ' +(sign_index >= index + 1 ? 'venusSelect' : '')"></view>
<view class='venus'
:class="(index + 1 === signSystemList.length ? 'reward' : '') + ' ' +(sign_index >= index + 1 ? 'venusSelect' : '')">
</view>
<view class='num' :class='item.is_sgin ? "on" : ""'>+{{item.integral}}</view>
</view>
</view>
<button class='but bg-color on' v-if="userInfo.isDaySign">已签到</button>
<button class='but bg-color on' v-if="signInfo.isDaySign">已签到</button>
<form @submit="goSign" report-submit='true' v-else>
<button class='but bg-color' formType="submit">立即签到</button>
</form>
@@ -47,11 +53,12 @@
<view class='item acea-row' v-for="(item,index) in signList" :key="index">
<view>
<view class='name line1'>{{item.title}}</view>
<view class='data'>{{item.add_time}}</view>
<view class='data'>{{item.createDay}}</view>
</view>
<view class='num font-color'>+{{item.number}}</view>
</view>
<view class='loading' @click='goSignList' v-if="signList.length >= 3">点击加载更多<text class='iconfont icon-xiangyou'></text></view>
<view class='loading' @click='goSignList' v-if="signList.length >= 3">点击加载更多<text
class='iconfont icon-xiangyou'></text></view>
</view>
</view>
<view class='signTip acea-row row-center-wrapper' :class='active==true?"on":""'>
@@ -65,7 +72,7 @@
<view class='mask' @touchmove.stop.prevent="false" :hidden='active==false'></view>
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
@@ -98,28 +105,28 @@
data() {
return {
active: false,
userInfo: {},
signCount: [],
signSystemList: [],
signList: [],
signInfo: {}, // 签到
integral: 0,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
day: 0,
sign_index: 0
sign_index: 0 //连续签到天数
};
},
computed: mapGetters(['isLogin']),
watch:{
isLogin:{
handler:function(newV,oldV){
if(newV){
computed: mapGetters(['isLogin', 'userInfo']),
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getUserInfo();
this.getSignSysteam();
this.getSignList();
}
},
deep:true
deep: true
}
},
onLoad() {
@@ -128,13 +135,7 @@
this.getSignSysteam();
this.getSignList();
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
methods: {
@@ -179,8 +180,8 @@
sign: 1
}).then(res => {
res.data.integral = parseInt(res.data.integral);
let sum_sgin_day = res.data.sumSignDay;
that.$set(that, 'userInfo', res.data);
let sum_sgin_day = res.data.sumSignDay; // 连续签到日期
that.$set(that, 'signInfo', res.data);
that.signCount = that.PrefixInteger(sum_sgin_day, 4);
that.sign_index = res.data.signNum;
});
@@ -226,17 +227,23 @@
*/
goSign: function(e) {
let that = this,
sum_sgin_day = that.userInfo.sumSignDay;
if (that.userInfo.isDaySign) return this.$util.Tips({
sum_sgin_day = that.signInfo.sumSignDay;
if (that.signInfo.isDaySign) return this.$util.Tips({
title: '您今日已签到!'
});
setSignIntegral().then(res => {
that.active = true;
that.integral = res.data.integral;
that.sign_index = (that.sign_index + 1) > that.signSystemList.length ? 1 : that.sign_index + 1;
that.sign_index = (that.sign_index + 1) > that.signSystemList.length ? 1 : that
.sign_index + 1;
that.signCount = that.PrefixInteger(sum_sgin_day + 1, 4);
that.$set(that.userInfo, 'isDaySign', true);
that.$set(that.userInfo, 'integral', that.$util.$h.Add(that.userInfo.integral, res.data.integral));
that.$set(that.signInfo, 'isDaySign', true);
// that.$set(that.signInfo, 'integral', that.$util.$h.Add(that.signInfo.integral, res.data
// .integral));
that.$store.commit("changInfo", {
amount1: 'integral',
amount2: that.$util.$h.Add(that.signInfo.integral, res.data.integral)
});
that.getSignList();
}).catch(err => {
return this.$util.Tips({
@@ -539,7 +546,7 @@
color: #eb4331;
width: 260rpx;
height: 76rpx;
background-color: #f8d168;
background: linear-gradient(90deg, #FFCA52 0%, #FE960F 100%);
border-radius: 38rpx;
line-height: 76rpx;
margin: 48rpx auto 0 auto;

View File

@@ -1,14 +1,14 @@
<template>
<view>
<view class='sign-record'>
<view class='list' v-for="(item,index) in signList" :key="index">
<view class='list pad30' v-for="(item,index) in signList" :key="index">
<view class='item'>
<view class='data'>{{item.month}}</view>
<view class='listn'>
<view class='listn borRadius14'>
<view class='itemn acea-row row-between-wrapper' v-for="(itemn,indexn) in item.list" :key="indexn">
<view>
<view class='name line1'>{{itemn.title}}</view>
<view>{{itemn.addTime}}</view>
<view>{{itemn.createDay}}</view>
</view>
<view class='num font-color'>+{{itemn.number}}</view>
</view>
@@ -20,7 +20,7 @@
</view>
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
@@ -65,13 +65,7 @@
if(this.isLogin){
this.getSignMoneList();
}else{
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
onReachBottom: function () {

View File

@@ -1,11 +1,12 @@
<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">
<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' />
<image :src="item.pic" class="slide-image" :class="swiperIndex == index ? 'active' : 'quiet'"
mode='aspectFill' />
</swiper-item>
</block>
</swiper>
@@ -21,11 +22,11 @@
<!-- #endif -->
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <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`}"/>
<canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}" />
</view>
</view>
</template>
@@ -45,7 +46,9 @@
mapGetters
} from "vuex";
// #ifdef MP
import { base64src } from '@/utils/base64src.js'
import {
base64src
} from '@/utils/base64src.js'
import authorize from '@/components/Authorize';
import {
getQrcode
@@ -72,7 +75,6 @@
duration: 500,
swiperIndex: 0,
spreadList: [],
userInfo: {},
poster: '',
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
@@ -82,7 +84,7 @@
canvasStatus: true //海报绘图标签
};
},
computed: mapGetters(['isLogin']),
computed: mapGetters(['isLogin', 'uid', 'userInfo']),
watch: {
isLogin: {
handler: function(newV, oldV) {
@@ -95,17 +97,9 @@
},
onLoad() {
if (this.isLogin) {
// // #ifdef H5
this.userSpreadBannerList();
// // #endif
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
/**
@@ -116,12 +110,11 @@
return {
title: this.userInfo.nickname + '-分销海报',
imageUrl: this.spreadList[0].pic,
path: '/pages/index/index?spid=' + this.userInfo.uid,
path: '/pages/index/index?spid=' + this.uid,
};
},
// #endif
onReady() {
},
onReady() {},
methods: {
userSpreadBannerList: function() {
let that = this;
@@ -140,48 +133,60 @@
uni.hideLoading();
});
},
getImageBase64:function(images){
getImageBase64: function(images) {
uni.showLoading({
title: '海报生成中',
mask: true
});
let that = this;
// #ifdef H5
let spreadList = [];
images.forEach((item,index)=>{
imageBase64({url:item.pic}).then(res=>{
spreadList[index] = res.data.code;
that.$set(that,'base64List',spreadList);
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
this.base64List = images.map(item => {
that.base64List = images.map(item => {
return item.pic
});
// #endif
that.userInfos();
// #ifdef MP
that.getQrcode();
// #endif
},
// 小程序二维码
getQrcode(){
getQrcode() {
let that = this;
let data = {
pid: that.userInfo.uid,
pid: that.uid,
path: 'pages/index/index'
}
let arrImagesUrl = "";
uni.downloadFile({
url: this.base64List[0],
url: this.base64List[0],
success: (res) => {
arrImagesUrl = res.tempFilePath;
}
});
getQrcode(data).then(res=>{
});
getQrcode(data).then(res => {
base64src(res.data.code, res => {
that.PromotionCode = res;
});
setTimeout(() => {
that.PosterCanvas(arrImagesUrl, that.PromotionCode, that.userInfo.nickname, 0);
that.PosterCanvas(arrImagesUrl, that.PromotionCode, that.userInfo.nickname, 0);
}, 300);
}).catch(err => {
uni.hideLoading();
@@ -189,26 +194,28 @@
title: err
});
that.$set(that, 'canvasStatus', false);
//that.getQrcode();
});
},
// 生成二维码;
make() {
let that = this;
let href = location.href.split('/pages')[0];
let href = '';
// #ifdef H5
href = window.location.href.split('/pages')[0];
// #endif
uQRCode.make({
canvasId: 'qrcode',
text: href+'/pages/index/index?spread=' + that.userInfo.uid,
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);
that.PosterCanvas(this.base64List[0], that.PromotionCode, that.userInfo
.nickname, 0);
}, 300);
},
complete: (res) => {
},
complete: (res) => {},
fail: res => {
uni.hideLoading();
that.$util.Tips({
@@ -217,7 +224,7 @@
}
})
},
PosterCanvas: function(arrImages, code, nickname,index) {
PosterCanvas: function(arrImages, code, nickname, index) {
let context = uni.createCanvasContext('canvasOne')
context.clearRect(0, 0, 0, 0);
let that = this;
@@ -232,21 +239,23 @@
context.fillText(nickname, 270, 980);
context.fillText('邀请您加入', 270, 1020);
setTimeout(() => {
context.draw(true,function(){
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);
}
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) {
@@ -273,15 +282,16 @@
this.swiperIndex = index;
let arrImagesUrl = "";
uni.downloadFile({
url: base64List[index],
url: base64List[index],
success: (res) => {
arrImagesUrl = res.tempFilePath;
setTimeout(() => {
this.$set(this, 'canvasStatus', true);
this.PosterCanvas(arrImagesUrl, this.PromotionCode, this.userInfo.nickname, index);
this.PosterCanvas(arrImagesUrl, this.PromotionCode, this.userInfo.nickname,
index);
}, 300);
}
});
});
},
// 点击保存海报
savePosterPath: function() {
@@ -327,43 +337,33 @@
}
});
},
userInfos() {
let that = this;
getUserInfo().then(res => {
that.userInfo = res.data;
// #ifdef H5
that.make();
that.setShareInfoStatus();
// #endif
// #ifdef MP
that.getQrcode();
// #endif
})
},
setShareInfoStatus: function() {
if (this.$wechat.isWeixin()) {
let configAppMessage = {
desc: '分销海报',
title: this.userInfo.nickname + '-分销海报',
link: '/pages/index/index?spread=' + this.userInfo.uid,
link: '/pages/index/index?spread=' + this.uid,
imgUrl: this.spreadList[0].pic
};
this.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], configAppMessage)
this.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"],
configAppMessage)
}
}
}
}
</script>
<style lang="scss">
<style lang="scss" scoped>
page {
background-color: #a3a3a3 !important;
height: 100% !important;
}
.canvas{
.canvas {
position: relative;
}
.distribution-posters{
.distribution-posters {
width: 100%;
height: 100%;
display: flex;
@@ -371,6 +371,7 @@
justify-content: center;
align-items: center;
}
.distribution-posters swiper {
width: 100%;
height: 1000rpx;

View File

@@ -6,25 +6,36 @@
<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'>{{recordCount}}</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'>
<view class='list pad30'>
<view class='item'>
<view class='data'>{{item.date}}</view>
<view class='listn'>
<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 === -1 ? '提现失败' : '提现成功'}}<span v-show="child.status === -1" style="font-size: 12px;color: red;">{{'('+child.failMsg+')'}}</span></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 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>
@@ -37,17 +48,18 @@
</view>
<view class='sign-record' v-else>
<block v-for="(item,index) in recordList" :key="index" v-if="recordList.length>0">
<view class='list'>
<view class='list pad30'>
<view class='item'>
<view class='data'>{{item.date}}</view>
<view class='listn'>
<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 font-color' v-if="child.type == 1">+{{child.price}}
</view>
<view class='num' v-else>-{{child.price}}</view>
</view>
</block>
@@ -56,12 +68,12 @@
</view>
</block>
<view v-if="recordList.length == 0">
<emptyPage title='暂无提现记录~'></emptyPage>
<emptyPage title='暂无佣金记录~'></emptyPage>
</view>
</view>
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
@@ -70,9 +82,7 @@
<script>
import {
getCommissionInfo,
getSpreadInfo,
getRecordApi,
getCountApi
} from '@/api/user.js';
import {
toLogin
@@ -93,6 +103,16 @@
emptyPage,
home
},
filters: {
statusFilter(status) {
const statusMap = {
'-1': '未通过',
'0': '审核中',
'1': '已提现'
}
return statusMap[status]
}
},
data() {
return {
name: '',
@@ -101,25 +121,20 @@
limit: 10,
recordList: [],
recordType: 0,
recordCount: 0,
status: false,
statuss: false,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false ,//是否隐藏授权
extractCount:0
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 {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
onShow: function() {
@@ -131,7 +146,6 @@
this.name = '提现总额';
this.recordType = 4;
this.getList();
this.getCount();
} else if (type == 2) {
uni.setNavigationBarTitle({
title: "佣金记录"
@@ -139,7 +153,6 @@
this.name = '佣金明细';
this.recordType = 3;
this.getRecordList();
this.getRecordListCount();
} else {
uni.showToast({
title: '参数错误',
@@ -166,7 +179,6 @@
methods: {
onLoadFun() {
this.getRecordList();
this.getRecordListCount();
},
// 授权关闭
authColse: function(e) {
@@ -176,58 +188,41 @@
let that = this;
let recordList = that.recordList;
let recordListNew = [];
if (that.status == true) return;
if (that.statuss == true) return;
getRecordApi({
page: that.page,
limit: that.limit
}).then(res => {
let len = res.data.list.length;
let recordListData = res.data.list;
let len = res.data.list ? res.data.list.length : 0;
let recordListData = res.data.list || [];
recordListNew = recordList.concat(recordListData);
that.status = that.limit > len;
that.statuss = that.limit > len;
that.page = that.page + 1;
that.$set(that, 'recordList', recordListNew);
});
},
getCount: function() {
let that = this;
if (status == true) return;
getCountApi({
page: that.page,
limit: that.limit
}).then(res => {
that.extractCount = res.data.count;
});
},
getRecordList: function() {
let that = this;
let page = that.page;
let limit = that.limit;
let status = that.status;
let statuss = that.statuss;
let recordType = that.recordType;
let recordList = that.recordList;
let recordListNew = [];
if (status == true) return;
if (statuss == true) return;
getCommissionInfo({
page: page,
limit: limit
}).then(res => {
if(res.data.list){
let len = res.data.list.length;
let recordListData = res.data.list;
if (res.data.list) {
let len = res.data.list ? res.data.list.length : 0;
let recordListData = res.data.list || [];
recordListNew = recordList.concat(recordListData);
that.status = limit > len;
that.statuss = limit > len;
that.page = page + 1;
that.$set(that, 'recordList', recordListNew);
}
});
},
getRecordListCount: function() {
let that = this;
getSpreadInfo().then(res => {
that.recordCount = res.data.commissionCount;
that.extractCount = res.data.extractCount;
});
}
},
onReachBottom: function() {

View File

@@ -4,7 +4,7 @@
<view class="header">
<view class='name acea-row row-center-wrapper'>
<view>当前佣金</view>
<navigator url='/pages/users/user_spread_money/index?type=1' hover-class="none" class='record'>提现记录<text class='iconfont icon-xiangyou'></text></navigator>
<navigator :url="'/pages/users/user_spread_money/index?type=1&extractCount='+spreadInfo.extractCount" hover-class="none" class='record'>提现记录<text class='iconfont icon-xiangyou'></text></navigator>
</view>
<view class='num'>{{spreadInfo.commissionCount}}</view>
<view class='profit acea-row row-between-wrapper'>
@@ -18,7 +18,7 @@
</view>
</view>
</view>
<!-- #ifdef APP-PLUS || H5 -->
<!-- #ifdef H5 -->
<navigator url="/pages/users/user_cash/index" hover-class="none" class='bnt bg-color'>立即提现</navigator>
<!-- #endif -->
<!-- #ifdef MP -->
@@ -33,7 +33,7 @@
<text class='iconfont icon-tongji'></text>
<view>推广人统计</view>
</navigator>
<navigator url='/pages/users/user_spread_money/index?type=2' hover-class="none" class='item acea-row row-center-wrapper row-column'>
<navigator :url="'/pages/users/user_spread_money/index?type=2&commissionCount='+spreadInfo.commissionCount" hover-class="none" class='item acea-row row-center-wrapper row-column'>
<text class='iconfont icon-qiandai'></text>
<view>佣金明细</view>
</navigator>
@@ -52,7 +52,7 @@
</view>
</view>
<!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
@@ -90,7 +90,7 @@
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getUserInfo();
this.getSpreadInfo();
}
},
deep: true
@@ -100,13 +100,7 @@
if (this.isLogin) {
this.getSpreadInfo();
} else {
// #ifdef H5 || APP-PLUS
toLogin();
// #endif
// #ifdef MP
this.isAuto = true;
this.$set(this, 'isShowAuth', true);
// #endif
}
},
methods: {
@@ -213,14 +207,14 @@
}
.my-promotion .list {
padding: 0 20rpx 50rpx 20rpx;
padding: 0 30rpx 50rpx 30rpx;
margin-top: 10rpx;
}
.my-promotion .list .item {
width: 345rpx;
width: 335rpx;
height: 240rpx;
border-radius: 20rpx;
border-radius: 14rpx;
background-color: #fff;
margin-top: 20rpx;
font-size: 30rpx;

View File

@@ -24,12 +24,15 @@
</view>
<view class="acea-row row-around row-middle">
<view class="spotw acea-row row-center" v-for="(item,index) in levelList" :key='index'>
<view class="spot" :class="current >item.experience?'past':'' + ' ' + current==item.experience?'on':''"></view>
<view class="spot"
:class="current >item.experience?'past':'' + ' ' + current==item.experience?'on':''">
</view>
</view>
</view>
</view>
<view class="numList acea-row row-around row-middle">
<view class="item" :class="current >=item.experience?'past':''" v-for="(item,index) in levelList" :key="index">{{item.experience}}</view>
<view class="item" :class="current >=item.experience?'past':''"
v-for="(item,index) in levelList" :key="index">{{item.experience}}</view>
</view>
</view>
<view class="vipList acea-row">
@@ -88,7 +91,8 @@
<view class="info line1">购买商品可获得对应是经验值</view>
</view>
</view>
<navigator url="/pages/goods_cate/goods_cate" class="button" hover-class="none" open-type='switchTab'>去获取</navigator>
<navigator url="/pages/goods_cate/goods_cate" class="button" hover-class="none"
open-type='switchTab'>去获取</navigator>
</view>
<!-- <view class="item acea-row row-between-wrapper">
<view class="picTxt acea-row row-middle">
@@ -128,7 +132,9 @@
<script>
import home from '@/components/home';
import {
getUserInfo,
mapGetters
} from "vuex";
import {
getlevelInfo,
getlevelExpList
} from '@/api/user.js';
@@ -136,9 +142,10 @@
components: {
home
},
computed: mapGetters(['userInfo']),
data() {
return {
userInfo: '',
//userInfo: '',
levelInfo: '',
levelList: [],
current: 0,
@@ -151,35 +158,19 @@
expList: []
};
},
onShow() {
this.getUserInfo();
onLoad() {
this.levelInfo = this.userInfo.experience;
this.getInfo();
this.getlevelList();
},
methods: {
/**
* 获取个人用户信息
*/
getUserInfo: function() {
let that = this;
getUserInfo().then(res => {
that.$store.commit("SETUID", res.data.uid);
that.$store.commit("UPDATE_USERINFO", res.data);
that.userInfo = res.data;
that.levelInfo = res.data.experience;
}).catch(function(res) {
return that.$util.Tips({
title: res
});
})
},
getInfo: function() {
let that = this;
getlevelInfo().then(res => {
let levelList = res.data.list;
let levelList = res.data;
let list = []
that.levelList = levelList;
levelList.forEach((item, index) => {
levelList.map((item, index) => {
if (item.experience <= that.levelInfo) {
list.push(item.experience)
}
@@ -187,7 +178,8 @@
let maxn = Math.max.apply(null, list);
that.current = maxn;
// 解决len取的值没有时
let levelListLen = levelList[list.length] ? levelList[list.length] : levelList[list.length - 1];
let levelListLen = levelList[list.length] ? levelList[list.length] : levelList[list
.length - 1];
// 解决除数不能为0
let divisor = levelListLen.experience - maxn ? levelListLen.experience - maxn : 1;
// 每小格所占的百分比
@@ -266,11 +258,13 @@
}
.vip {
padding: 2rpx 8rpx;
padding: 6rpx 18rpx;
border: 1px solid rgba(250, 226, 193, 1);
border-radius: 20rpx;
font-size: 18rpx;
margin-left: 15rpx;
display: flex;
align-items: center;
image {
width: 20rpx;
@@ -293,7 +287,7 @@
border-radius: 23rpx;
padding: 22rpx 27rpx;
box-sizing: border-box;
.title {
font-size: 24rpx;
color: #AE8B4A;
@@ -307,12 +301,15 @@
.axis {
margin: 10rpx 0 15rpx 0;
overflow: hidden;
overflow: hidden;
.bar {
width: 630rpx;
.spotw{
.spotw {
width: 96rpx;
}
.barCon {
width: 100%;
height: 3rpx;
@@ -485,7 +482,7 @@
.item {
height: 122rpx;
border-bottom: 1px solid #EEEEEE;
.text {
.name {
font-size: 28rpx;
@@ -500,10 +497,11 @@
.num {
font-size: 32rpx;
color: #16AC57;
color: $theme-color;
}
.on{
color: #E93323;
.on {
color: #16AC57;
}
}
}

View File

@@ -0,0 +1,37 @@
<template>
<web-view class="web-view" :webview-styles="webviewStyles" :src="url" :style="{width: windowW + 'px', height: windowH + 'px'}"></web-view>
</template>
<script>
import {
mapGetters
} from "vuex";
export default {
//computed: mapGetters(['chatUrl']),
data() {
return {
windowH: 0,
windowW: 0,
webviewStyles: {
progress: {
color: 'transparent'
}
},
url: ''
}
},
onLoad(option) {
if(option.webUel) this.url = option.webUel;
uni.setNavigationBarTitle({
title: option.title
})
try {
const res = uni.getSystemInfoSync();
this.windowW = res.windowWidth;
this.windowH = res.windowHeight;
} catch (e) {
// error
}
}
}
</script>

View File

@@ -21,7 +21,7 @@
<button hover-class="none" @click="wechatLogin" class="bg-green btn1">微信登录</button>
<!-- #endif -->
<!-- #ifdef MP -->
<button hover-class="none" open-type="getUserInfo" @getuserinfo="setUserInfo" class="bg-green btn1">微信登录</button>
<button hover-class="none" @tap="getUserProfile" class="bg-green btn1">微信登录</button>
<!-- #endif -->
<!-- <button hover-class="none" @click="isUp = true" class="btn2">手机号登录</button> -->
</view>
@@ -30,7 +30,8 @@
<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>
<routinePhone :logoUrl="logoUrl" :isPhoneBox="isPhoneBox" @close="bindPhoneClose" :authKey="authKey">
</routinePhone>
</block>
</view>
</template>
@@ -45,9 +46,7 @@
} from "vuex";
import {
getLogo,
silenceAuth,
getUserPhone,
wechatAuthV2
getUserPhone
} from '@/api/public';
import {
LOGO_URL,
@@ -80,12 +79,7 @@
mobileLogin,
routinePhone
},
computed: mapGetters({
'authorizeType': 'authorizeType'
}),
onLoad(options) {
console.log('options',options)
if (this.authorizeType === 'register') this.isPhoneBox = true
getLogo().then(res => {
this.logoUrl = res.data.logoUrl
})
@@ -93,7 +87,8 @@
// #ifdef H5
document.body.addEventListener("focusout", () => {
setTimeout(() => {
const scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0;
const scrollHeight = document.documentElement.scrollTop || document.body.scrollTop ||
0;
window.scrollTo(0, Math.max(scrollHeight - 1, 0));
}, 100);
});
@@ -103,39 +98,31 @@
scope
} = options;
this.options = options
console.log('lalaal',this.options)
// 获取确认授权code
this.code = code || ''
if(!code) location.replace(decodeURIComponent(decodeURIComponent(option.query.back_url)));
//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;
//公众号授权登录回调 wechatAuth(code, Cache.get("spread"), loginType)
wechat.auth(code, spread).then(res => {
console.log('进来的授权',res)
if (res.type === 'register') {
this.authKey = res.key;
console.log('authKey',this.authKey)
this.isUp = true
this.authKey = res.key;
this.isUp = true
}
if(res.type === 'login'){
// let time = res.data.expires_time - this.$Cache.time();
if (res.type === 'login') {
this.$store.commit('LOGIN', {
token: res.data.token,
// time: time
token: res.token
});
// this.$store.commit('SETUID', res.data.userInfo.uid);
// this.$store.commit('UPDATE_USERINFO', res.data.userInfo);
this.$store.commit("SETUID", res.uid);
this.getUserInfo();
this.wechatPhone();
//location.replace(decodeURIComponent(decodeURIComponent(option.query.back_url)));
}
}).catch(error => {
});
}).catch(error => {});
}
// #endif
let pages = getCurrentPages();
console.log('数据库1',pages)
// let prePage = pages[pages.length - 2];
// console.log('数据库',prePage)
// if (prePage.route == 'pages/order_addcart/order_addcart') {
// this.isHome = true
// } else {
@@ -191,20 +178,15 @@
encryptedData: encryptedData,
iv: iv,
code: code,
spid: app.globalData.spid,
spread: app.globalData.code,
type: 'routine',
key: this.authKey
})
.then(res => {
let time = res.data.expires_time - this.$Cache.time();
this.$store.commit('LOGIN', {
token: res.data.token,
time: time
token: res.data.token
});
this.userInfo = res.data.userInfo
this.$store.commit("SETUID", res.data.userInfo.uid);
this.$store.commit("UPDATE_USERINFO", res.data.userInfo);
this.$store.commit("SETUID", res.data.uid);
this.getUserInfo();
this.$util.Tips({
title: '登录成功',
icon: 'success'
@@ -216,8 +198,8 @@
.catch(res => {
uni.hideLoading();
that.$util.Tips({
title: res
});
title: res
});
});
},
/**
@@ -228,7 +210,6 @@
getUserInfo().then(res => {
uni.hideLoading();
that.userInfo = res.data
that.$store.commit("SETUID", res.data.uid);
that.$store.commit("UPDATE_USERINFO", res.data);
that.$util.Tips({
title: '登录成功',
@@ -238,63 +219,19 @@
})
});
},
setUserInfo(e) {
getUserProfile() {
let self = this;
uni.showLoading({
title: '正在登录中'
});
Routine.getCode()
.then(code => {
this.getWxUser(code);
})
.catch(res => {
uni.hideLoading();
});
},
getWxUser(code) {
let self = this
Routine.getUserInfo()
Routine.getUserProfile()
.then(res => {
console.log('res1',res);
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'
Routine.authUserInfo(userInfo.code, userInfo)
.then(res => {
console.log(res)
self.authKey = res.data.key;
if (res.data.type === 'register') {
uni.hideLoading();
self.isPhoneBox = true
} else {
uni.hideLoading();
let time = res.data.expires_time - self.$Cache.time();
self.$store.commit('LOGIN', {
token: res.data.token,
time: time
});
self.$util.Tips({
title: res,
icon: 'success'
}, {
tab: 3
})
}
Routine.getCode()
.then(code => {
self.getWxUser(code, res);
})
.catch(res => {
uni.hideLoading();
uni.showToast({
title: res,
icon: 'none',
duration: 2000
});
});
})
.catch(res => {
@@ -302,6 +239,52 @@
});
},
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'
Routine.authUserInfo(userInfo.code, userInfo)
.then(res => {
self.authKey = res.data.key;
if (res.data.type === 'register') {
uni.hideLoading();
self.isPhoneBox = true
}
if (res.data.type === 'login') {
uni.hideLoading();
self.$store.commit('LOGIN', {
token: res.data.token
});
self.$store.commit("SETUID", res.data.uid);
self.getUserInfo();
self.$util.Tips({
title: res,
icon: 'success'
}, {
tab: 3
})
}
})
.catch(res => {
uni.hideLoading();
uni.showToast({
title: res,
icon: 'none',
duration: 2000
});
});
},
// #endif
// #ifdef H5
@@ -321,50 +304,34 @@
},
// 公众号登录
wechatLogin() {
console.log('微信登录',this.code)
console.log('微信登录2',this.options.code)
console.log('微信登录3',this.authKey)
console.log('isUp2',this.isUp)
if (!this.code && this.options.scope !== 'snsapi_base') {
this.$wechat.oAuth('snsapi_userinfo', '/pages/users/wechat_login/index');
} else {
console.log('isUp',this.isUp)
// if (this.authKey) {
// this.isUp = true;
// }
this.isUp = true;
}
// wechat.auth(this.code, this.$Cache.get("spread")).then(res => {
// if (res.data.type === 'register') {
// this.authKey = res.data.key;
// this.isUp = true
// }
// if(res.data.type === 'login'){
// let time = res.data.expires_time - this.$Cache.time();
// this.$store.commit('LOGIN', {
// token: res.data.token,
// time: time
// });
// this.$store.commit('SETUID', res.data.userInfo.uid);
// this.$store.commit('UPDATE_USERINFO', res.data.userInfo);
// // location.replace(decodeURIComponent(decodeURIComponent(option.query.back_url)));
// }
// }).catch(error => {
// // location.replace("/");
// });
},
// 输入手机号后的回调
wechatPhone() {
this.$Cache.clear('snsapiKey');
if (this.options.back_url) {
let url = uni.getStorageSync('snRouter')
let self = this
let url = uni.getStorageSync('snRouter');
url = url.indexOf('/pages/index/index') != -1 ? '/' : url;
if (url.indexOf('/pages/users/wechat_login/index') !== -1) {
url = '/';
}
if (!url) {
url = '/pages/index/index';
}
this.isUp = false
uni.showToast({
title: '登录成功',
icon: 'none'
})
setTimeout(res => {
location.href = url.indexOf("/pages/index/index") != -1 ? '/' : url
location.href = url
}, 800)
} else {
uni.navigateBack()
@@ -378,10 +345,12 @@
<style lang="scss">
page {
background: #fff;
height: 100%;
}
.page {
background: #fff;
height: 100%;
}
.wechat_login {