first commit

This commit is contained in:
PC-202306242200\Administrator
2026-03-28 23:07:10 +08:00
commit c7cbc11d07
594 changed files with 112383 additions and 0 deletions

59
pages/auth/index.vue Normal file
View File

@@ -0,0 +1,59 @@
<template>
<view class="lottie-bg">
<view id="lottie">
<image src="/static/img/live-logo.gif" rel="preload" />
</view>
</view>
</template>
<script>
import {
getUserInfo
} from "@/api/user";
export default {
name: "Auth",
mounted() {
},
onLoad(option) {
let that = this
const {
code,
state
} = option;
}
};
</script>
<style scoped lang="scss">
.lottie-bg {
position: fixed;
left: 0;
top: 0;
background-color: #fff;
width: 100%;
height: 100%;
z-index: 999;
display: flex;
align-items: center;
justify-content: center;
}
#lottie {
display: block;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
transform: translate3d(0, 0, 0);
margin: auto;
image {
width: 200rpx;
height: 200rpx;
}
}
</style>

View File

@@ -0,0 +1,143 @@
<template>
<div class="quality-recommend">
<div class="slider-banner swiper">
<view class="swiper">
<swiper indicator-dots="true" :autoplay="autoplay" :circular="circular" :interval="interval" :duration="duration"
indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
<block v-for="(item,index) in imgUrls" :key="index">
<swiper-item>
<image :src="item.pic" class="slide-image"></image>
</swiper-item>
</block>
</swiper>
</view>
</div>
<div class="title acea-row row-center-wrapper">
<div class="line"></div>
<div class="name">
<span class="iconfont" :class="icon"></span>{{ name }}
</div>
<div class="line"></div>
</div>
<view class="wrapper">
<GoodList :bastList="goodsList" :is-sort="false"></GoodList>
<view class="txt-bar" v-if="goodsList.length>0 && !isScroll">我是有底线的~</view>
<emptyPage v-if="goodsList.length==0 && !isScroll" title="暂无数据~"></emptyPage>
</view>
</div>
</template>
<script>
import emptyPage from '@/components/emptyPage.vue'
import GoodList from "@/components/goodList";
import { getGroomList } from "@/api/store";
export default {
name: "HotNewGoods",
components: {
GoodList,
emptyPage,
},
props: {},
data: function() {
return {
imgUrls: [],
goodsList: [],
name: "",
icon: "",
type:0,
autoplay:true,
circular:true,
interval: 3000,
duration: 500,
page:1,
limit:8,
isScroll:true
};
},
onLoad: function(option) {
this.type = option.type
this.titleInfo();
this.getIndexGroomList();
},
methods: {
titleInfo: function() {
if (this.type === "1") {
this.name = "精品推荐";
this.icon = "icon-jingpintuijian";
uni.setNavigationBarTitle({
title:"精品推荐"
})
} else if (this.type === "2") {
this.name = "热门榜单";
this.icon = "icon-remen";
uni.setNavigationBarTitle({
title:"热门榜单"
})
} else if (this.type === "3") {
this.name = "首发新品";
this.icon = "icon-xinpin";
uni.setNavigationBarTitle({
title:"首发新品"
})
}else if (this.type === "4") {
this.name = "促销单品";
this.icon = "icon-xinpin";
uni.setNavigationBarTitle({
title:"促销单品"
})
}
},
getIndexGroomList: function() {
if(!this.isScroll) return
let that = this;
let type = this.type;
getGroomList(type,{
page:this.page,
limit:this.limit
}).then(res => {
that.imgUrls = res.data.banner;
that.goodsList = that.goodsList.concat(res.data.list);
that.isScroll = res.data.list.length>=that.limit
that.page++
})
.catch(function(res) {
that.$util.Tips({ title: res });
});
}
},
onReachBottom() {
this.getIndexGroomList()
}
};
</script>
<style lang="scss">
::v-deep .empty-box{
background-color: #f5f5f5;
}
.swiper,swiper,swiper-item,.slide-image{
width: 100%;
height: 280rpx;
}
.quality-recommend {
.wrapper{
background: #fff;
}
.title {
height: 120rpx;
font-size:32rpx;
color: #282828;
background-color: #f5f5f5;
.line{
width: 230rpx;
height: 2rpx;
background-color: #e9e9e9;
}
}
}
.txt-bar{
padding: 20rpx 0;
text-align: center;
font-size: 26rpx;
color: #666;
background-color: #f5f5f5;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,999 @@
<template>
<div class="broadcast-details" :style="'height:'+windowH+'px'">
<view class="hd-wrapper" :class="active === true ? 'on' : ''">
<scroll-view scroll-y="true" style="height: 100%; overflow: hidden;" :scroll-top="scrollTop" scroll-with-animation="true">
<div class="broadcast-details_order">
<div class="broadcast-details_box" v-if="productId && productInfo.id">
<div class="broadcast_details_img">
<img :src="productInfo.image" />
</div>
<div class="broadcast_details_picBox">
<div class="broadcast_details_tit" v-text="productInfo.storeName"></div>
<div class="acea-row row-between">
<div class="broadcast_details_pic">
{{ productInfo.price
}}<span class="broadcast_details_pic_num">{{ productInfo.otPrice }}</span>
</div>
<div class="broadcast_details_btn" @click="sendProduct">
发送客服
</div>
</div>
</div>
</div>
<div class="broadcast_box" v-if="orderId && orderInfo.id">
<div class="broadcast-details_num broadcast_num">
<span>订单号{{ orderInfo.order_id }}</span>
<span>{{ orderInfo.add_time_y }} {{ orderInfo.add_time_h }}</span>
</div>
<div class="broadcast-details_box">
<div class="broadcast_details_img">
<img :src="cartInfo.productInfo.image" />
<div class="broadcast_details_model">
{{ orderInfo.cartInfo ? orderInfo.cartInfo.length : 0 }}件商品
</div>
</div>
<div class="broadcast_details_picBox">
<div class="broadcast_details_tit">
{{ cartInfo.productInfo.store_name }}
</div>
<div class="acea-row row-between">
<div class="broadcast_details_pic">
{{ cartInfo.productInfo.price
}}<span class="broadcast_details_pic_num">{{ cartInfo.productInfo.ot_price }}</span>
</div>
<div class="broadcast_details_btn" @click="sendOrder">
发送客服
</div>
</div>
</div>
</div>
</div>
</div>
<div class="chat" ref="chat" >
<template v-for="item in history">
<div class="item acea-row row-top" v-if="item.uid === toUid" :key="item.id">
<div class="pictrue"><img :src="item.avatar" /></div>
<div class="text">
<div class="name">{{ item.nickname }}</div>
<div class="acea-row">
<!--商品链接-->
<div v-if="item.msn_type === 6 && item.orderInfo.id">
<router-link class="broadcast-details_num" :to="{
path: '/pages/admin/orderDetail/index?id=' + item.orderInfo.order_id
}">
<span>订单号{{ item.orderInfo.order_id }}</span>
</router-link>
<div class="conter acea-row row-middle">
<div class="broadcast-details_order noPad" v-for="(val, inx) in item.orderInfo.cartInfo" :key="val.id">
<router-link class="broadcast-details_box noPad" :to="{ path: '/pages/goods_details/index?id=' + val.product_id }" v-if="inx == 0">
<div class="broadcast_details_img">
<img :src="val.productInfo.image" />
<div class="broadcast_details_model">
{{
item.orderInfo.cartInfo
? item.orderInfo.cartInfo.length
: 0
}}件商品
</div>
</div>
<div class="broadcast_details_picBox noPad">
<div class="broadcast_details_tit" v-text="val.productInfo.store_name"></div>
<div class="broadcast_details_pic">
{{ val.productInfo.price }}
</div>
</div>
</router-link>
</div>
</div>
</div>
<!--商品链接-->
<div class="conter acea-row row-middle" v-if="item.msn_type === 5">
<div class=" noPad">
<router-link class="acea-row row-column-around noPad" v-if="item.productInfo.id" :to="{ path: '/pages/goods_details/index?id=' + item.productInfo.id }">
<div class="broadcast_details_img_no">
<img :src="item.productInfo.image" />
</div>
<div class="broadcast_details_picBox_no noPad">
<div class="broadcast_details_pic">
{{ item.productInfo.price }}
</div>
<div class="broadcast_details_tit_no" v-text="item.productInfo.store_name"></div>
</div>
</router-link>
</div>
</div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 4">
<img src="/static/images/signal2.gif" class="signal" style="margin-right: 0.27rem;" />12
</div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 3">
<img :src="item.msn" />
</div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 2">
<i class="em" :class="item.msn"></i>
</div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 1">
{{ item.msn }}
</div>
</div>
</div>
</div>
<div class="item acea-row row-top row-right" v-else :key="item.id">
<div class="text textR">
<div class="name">{{ item.nickname }}</div>
<div class="acea-row ">
<!--商品链接-->
<router-link v-if="item.msn_type === 6 && item.orderInfo.id" :to="{
path: '/pages/admin/orderDetail/index?id=' + item.orderInfo.order_id
}">
<div class="broadcast-details_num">
<span>订单号{{ item.orderInfo.order_id }}</span>
</div>
<div class="conter acea-row row-middle">
<div class="broadcast-details_order noPad" v-for="(val, inx) in item.orderInfo.cartInfo" :key="val.id">
<div class="broadcast-details_box noPad" v-if="inx == 0">
<div class="broadcast_details_img">
<img :src="val.productInfo.image" />
<div class="broadcast_details_model">
{{
item.orderInfo.cartInfo
? item.orderInfo.cartInfo.length
: 0
}}件商品
</div>
</div>
<div class="broadcast_details_picBox noPad">
<div class="broadcast_details_tit" v-text="val.productInfo.store_name"></div>
<div class="broadcast_details_pic">
{{ val.productInfo.price }}
</div>
</div>
</div>
</div>
</div>
</router-link>
<!--商品链接-->
<div class="conter acea-row row-middle" v-if="item.msn_type === 5">
<div class=" noPad">
<router-link class="acea-row row-column-around noPad" v-if="item.productInfo.id" :to="{ path: '/pages/goods_details/index?id=' + item.productInfo.id }">
<div class="broadcast_details_img_no">
<img :src="item.productInfo.image" />
</div>
<div class="broadcast_details_picBox_no noPad">
<div class="broadcast_details_pic">
{{ item.productInfo.price }}
</div>
<div class="broadcast_details_tit_no" v-text="item.productInfo.store_name"></div>
</div>
</router-link>
</div>
</div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 3">
<img :src="item.msn" />
</div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 2">
<i class="em" :class="item.msn"></i>
</div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 1">
{{ item.msn }}
</div>
</div>
</div>
<div class="pictrue"><img :src="item.avatar" /></div>
</div>
</template>
</div>
<div :style=" active === true
? 'height:' + footerConH + 'rem;'
: 'height:' + footerH + 'rem;'
"></div>
</scroll-view>
</view>
<div class="footerCon" :class="active === true ? 'on' : ''" :style="'transform: translate3d(0,' + percent + '%,0);'" ref="footerCon">
<form>
<div class="footer acea-row row-between row-bottom" ref="footer">
<!--<img-->
<!--:src="-->
<!--voice === true-->
<!--? require('@assets/images/keyboard.png')-->
<!--: require('@assets/images/voice.png')-->
<!--"-->
<!--@click="voiceBnt"-->
<!--/>-->
<img @click="uploadImg" src="/static/images/plus.png" />
<img :src="
active === true
? '/static/images/keyboard.png'
: '/static/images/face.png'
"
@click="emoticon" />
<div class="voice acea-row row-center-wrapper" v-if="voice" @touchstart.prevent="start" @touchmove.prevent="move"
@touchend.prevent="end">
{{ speak }}
</div>
<!-- <p contenteditable="true" class="input" ref="input" v-show="!voice" @keydown="keydown($event)" @keyup="keyup" @focus="focus"></p> -->
<input type="text" placeholder="请输入内容" class="input" ref="input" v-show="!voice" @input="bindInput" @keyup="keyup"
@focus="focus" cursor-spacing="20" v-model="textCon">
<div class="send" :class="sendColor === true ? 'font-color-red' : ''" @click="sendTest">
发送
</div>
</div>
</form>
<div class="banner slider-banner">
<swiper class="swiper-wrapper" :autoplay="autoplay" :circular="circular" :interval="interval" :duration="duration"
v-if="emojiGroup.length > 0">
<block v-for="(emojiList, index) in emojiGroup" :key="index">
<swiper-item>
<i class="em" :class="emoji" v-for="emoji in emojiList" :key="emoji" @click="addEmoji(emoji)"></i>
<img src="/static/images/del.png" class="emoji-outer" />
</swiper-item>
</block>
<!-- <swiper-slide class="swiper-slide acea-row" v-for="(emojiList, index) in emojiGroup" :key="index">
<i class="em" :class="emoji" v-for="emoji in emojiList" :key="emoji" @click="addEmoji(emoji)"></i>
<img src="/static/images/del.png" class="emoji-outer" />
</swiper-slide>
<div class="swiper-pagination" slot="pagination"></div> -->
</swiper>
</div>
</div>
<div class="recording" v-if="recording">
<img src="/static/images/recording.png" />
</div>
<home></home>
</div>
</template>
<script>
import emojiList from "@/utils/emoji";
import Socket from "@/libs/chat";
import {
getChatRecord
} from "@/api/user";
import {
getProductDetail
} from "@/api/store";
import {
getOrderDetail
} from "@/api/order";
import easyUpload from '@/components/easy-upload/easy-upload.vue'
import {
TOKENNAME,
HTTP_REQUEST_URL
} from '@/config/app.js';
import home from '@/components/home';
const chunk = function(arr, num) {
num = num * 1 || 1;
var ret = [];
arr.forEach(function(item, i) {
if (i % num === 0) {
ret.push([]);
}
ret[ret.length - 1].push(item);
});
return ret;
};
const NAME = "CustomerService";
export default {
name: NAME,
components: {
easyUpload,
home
},
props: {
couponList: {
type: Array,
default: () => []
}
},
data: function() {
return {
url: `${HTTP_REQUEST_URL}/api/upload/image`,
headers: {
"Authori-zation": "Bearer " + this.$store.state.app.token
},
emojiGroup: chunk(emojiList, 20),
active: false,
voice: false,
speak: "按住 说话",
recording: false,
swiperOption: {
pagination: {
el: ".swiper-pagination",
clickable: true
},
speed: 1000,
observer: true,
observeParents: true
},
percent: 0,
footerConH: 0,
footerH: 1.08,
socket: null,
toUid: 0,
page: 1,
limit: 30,
loading: false,
loaded: false,
history: [],
sendColor: false,
sendtxt: "",
productId: 0,
productInfo: {},
orderId: "",
orderInfo: {},
cartInfo: {},
autoplay: false,
circular: true,
interval: 3000,
duration: 500,
upload_max: 2, //图片大小
//上传的图片地址
uploadImages: [],
//展示的图片地址
uploads: [],
// 超出限制数组
exceeded_list: [],
windowH: 0,
isBQ: false,
scrollTop:0 ,//滚动距离
textCon:'' //文字
};
},
watch: {
$route(n) {
if (n.name === NAME) {
if (n.params.productId) this.productId = n.params.productId;
else this.productId = 0;
if (n.query.orderId) this.orderId = n.query.orderId;
else this.orderId = "";
}
}
},
beforeDestroy() {
this.socket && this.socket.close();
},
onLoad(option) {
let self = this
this.toUid = option.uid || 0;
this.productId = parseInt(option.productId) || 0;
this.orderId = option.orderId || ""
uni.getSystemInfo({
success: function(res) {
self.windowH = res.windowHeight
}
})
},
onReady: function() {
this.height();
this.getHistory();
this.getproductInfo();
this.getOrderInfo();
this.socket = new Socket();
this.socket.vm(this);
this.$on(["reply", "chat"], data => {
this.history.push(data);
this.$nextTick(function() {
window.scrollTo(0, document.documentElement.scrollHeight + 999);
});
});
this.$on("socket_error", () => {
this.$dialog.error("连接失败");
});
this.$on("err_tip", data => {
this.$dialog.error(data);
});
this.$on("socket_open", () => {
this.socket.send({
data: {
id: this.toUid
},
type: "to_chat"
});
});
document.addEventListener("scroll", this.scroll, false);
},
destroyed() {
document.removeEventListener("scroll", this.scroll);
},
methods: {
uploadImg() {
let self = this
uni.chooseImage({
count: 1, //默认1
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], //从相册选择
success: (res) => {
for (let i = 0; i < res.tempFiles.length; i++) {
if (Math.ceil(res.tempFiles[i].size / 1024) < this.upload_max * 1024) {
this.uploads.push(res.tempFiles[i].path)
this.uploadImages.push(res.tempFiles[i].path)
} else {
this.exceeded_list.push(i === 0 ? 1 : i + 1);
uni.showModal({
title: '提示',
content: `${[...new Set(this.exceeded_list)].join(',')}张图片超出限制${this.upload_max}MB,已过滤`
});
}
}
uni.uploadFile({
url: self.url, //仅为示例,非真实的接口地址
filePath: self.uploadImages[0],
name: 'file',
header: {
"Authori-zation": "Bearer " + self.$store.state.app.token
},
//请求参数
success: (uploadFileRes) => {
let data = JSON.parse(uploadFileRes.data)
self.sendMsg(data.data.url, 3)
}
});
},
fail: (err) => {
uni.showModal({
content: JSON.stringify(err)
});
}
});
},
getOrderInfo() {
if (!this.orderId) return;
getOrderDetail(this.orderId).then(res => {
this.orderInfo = res.data;
if (this.orderInfo.add_time_h) {
this.orderInfo.add_time_h = this.orderInfo.add_time_h.substring(
0,
this.orderInfo.add_time_h.lastIndexOf(":")
);
}
if (this.orderInfo.cartInfo.length) {
this.cartInfo = this.orderInfo.cartInfo[0];
}
});
},
getproductInfo() {
let that = this;
if (!this.productId) return;
getProductDetail(this.productId).then(res => {
that.productInfo = res.data.storeInfo;
});
},
scroll() {
if (window.scrollY < 300 && !this.loaded && !this.loading)
this.getHistory();
},
imageuploaded(res) {
if (res.status !== 200) return this.$dialog.error(res || "上传图片失败");
this.sendMsg(res.data.url, 3);
},
getHistory() {
if (this.loading || this.loaded) return;
this.loading = true;
getChatRecord(this.toUid, {
page: this.page,
limit: this.limit
})
.then(({
data
}) => {
this.history = data.list.concat(this.history);
if (this.page === 1) {
this.$nextTick(function() {
window.scrollTo(0, document.documentElement.scrollHeight + 999);
this.height();
});
}
this.page++;
this.loading = false;
this.loaded = data.length < this.limit;
})
.catch(err => {
this.$dialog.error(err || "加载失败");
});
},
focus: function() {
this.active = false;
},
keyup: function() {
if (this.$refs.input.innerHTML.length > 0) {
this.sendColor = true;
} else {
this.sendColor = false;
}
},
addEmoji(name) {
this.sendMsg(name, 2);
},
sendMsg(msn, type) {
this.height();
this.socket.send({
data: {
msn,
type,
to_uid: this.toUid
},
type: "chat"
});
},
sendTest() {
this.sendMsg(this.textCon, 1);
this.textCon = ''
this.height();
},
sendProduct() {
this.sendMsg(this.productId, 5);
this.productId = 0;
this.productInfo = {};
},
sendOrder() {
this.sendMsg(this.orderId, 6);
this.orderId = 0;
this.orderInfo = {};
},
bindInput: function(e) {
if(e.detail.value){
this.sendColor = true
}else{
this.sendColor = false
}
this.height();
},
start() {
var that = this;
this.longClick = 0;
this.timeOutEvent = setTimeout(function() {
that.longClick = 1;
}, 500);
that.speak = "松开 结束";
that.recording = true;
},
move() {
clearTimeout(this.timeOutEvent);
this.timeOutEvent = 0;
},
end() {
clearTimeout(this.timeOutEvent);
if (this.timeOutEvent !== 0 && this.longClick === 0) {
//点击
//此处为点击事件----在此处添加跳转详情页
}
this.speak = "按住 说话";
this.recording = false;
return false;
},
voiceBnt: function() {
this.active = false;
if (this.voice === true) {
this.voice = false;
this.$nextTick(function() {
this.$refs.input.focus();
});
} else {
this.voice = true;
}
window.scrollTo(0, document.documentElement.scrollHeight);
this.percent = 0;
this.footerConH = 0;
this.footerH = 0;
this.$nextTick(function() {
this.height();
});
},
emoticon: function() {
this.voice = false;
if (this.active === true) {
this.active = false;
this.isBQ = false
// this.$nextTick(function() {
// this.$refs.input.focus();
// });
} else {
this.active = true;
this.isBQ = true
// this.$nextTick(function() {
// this.$refs.input.blur();
// });
}
this.height();
},
height() {
let scrollTop = 0
let footerConH = this.$refs.footerCon.offsetHeight;
let footerH = this.$refs.footer.offsetHeight;
let scale = 750 / window.screen.availWidth;
this.footerConH = (footerConH * scale) / 100;
this.footerH = (footerH * scale) / 100;
this.percent = ((this.footerConH - this.footerH) / this.footerConH) * 100;
setTimeout(res=>{
let info = uni.createSelectorQuery().select(".chat");
info.boundingClientRect(function(data) { //data - 各种参数
// 获取元素宽度
scrollTop = data.height
}).exec()
if(this.active){
this.scrollTop = scrollTop+500
}else{
this.scrollTop = scrollTop+100
}
},600)
},
}
};
</script>
<style lang="scss">
page {
width: 100%;
height: 100%;
}
/* #ifdef H5 */
@import url("@/plugin/emoji-awesome/css/google.min.css");
/* #endif */
.broadcast_num {
padding: 0 10rpx !important;
}
.noPad {
padding: 0 !important;
margin-bottom: 0 !important;
height: auto !important;
}
.broadcast-details_num {
width: 100%;
height: 80rpx;
line-height: 80rpx;
color: #000000;
font-size: 26rpx;
display: flex;
justify-content: space-between;
background: #fff;
border-bottom: 1px dashed rgba(0, 0, 0, 0.2);
padding: 0 24rpx;
}
.broadcast-details_order {
padding: 15rpx;
}
.broadcast-details_box {
padding: 24rpx;
display: flex;
background: #fff;
border-radius: 6px;
margin-bottom: 24rpx;
}
.broadcast_details_model {
width: 100%;
height: 43rpx;
background: rgba(0, 0, 0, 0.5);
border-radius: 0px 0px 8px 8px;
position: absolute;
z-index: 2;
bottom: 0;
font-size: 22rpx;
color: #fff;
text-align: center;
line-height: 43rpx;
}
.broadcast_details_img {
width: 140rpx;
height: 140rpx;
border-radius: 8px;
overflow: hidden;
position: relative;
}
.broadcast_details_img img {
width: 100%;
height: 100%;
}
.broadcast_details_img_no {
width: 100%;
height: auto;
border-radius: 8px 8px 0px 0px;
overflow: hidden;
margin-bottom: 10rpx;
}
.broadcast_details_picBox_no {
width: 100%;
}
.broadcast_details_img_no img {
width: 100%;
height: 100%;
}
.broadcast_details_tit {
font-size: 28rpx;
color: #333333;
height: 85rpx;
font-weight: 800;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
text-align: left !important;
}
.broadcast_details_tit_no {
font-size: 28rpx;
color: #333333;
font-weight: 800;
text-align: left;
margin-top: 5rpx;
}
.broadcast_details_picBox {
width: 75%;
margin-left: 24rpx;
}
.broadcast_details_pic {
font-size: 36rpx;
color: $theme-color;
text-align: left;
}
.broadcast_details_pic_num {
text-decoration: line-through;
font-size: 28rpx;
color: rgba(0, 0, 0, 0.5);
margin-left: 0.1rem;
}
.broadcast_details_btn {
width: 160rpx;
height: 50rpx;
background: #e83323;
opacity: 1;
border-radius: 125rpx;
color: #fff;
font-size: 24rpx;
text-align: center;
line-height: 50rpx;
}
.broadcast-details .chat {
padding: 1rpx 23rpx 0 3rpx;
margin-bottom: 3rpx;
}
.broadcast-details .chat .item {
margin-top: 37rpx;
}
.broadcast-details .chat .item .pictrue {
width: 80rpx;
height: 80rpx;
margin-top: 10rpx;
}
.broadcast-details .chat .item .pictrue img {
width: 100%;
height: 100%;
border-radius: 50%;
}
.broadcast-details .chat .item .text {
margin-left: 20rpx;
}
.broadcast-details .chat .item .text.textR {
text-align: right;
margin: 0 20rpx 0 0;
}
.broadcast-details .chat .item .text .name {
font-size: 24rpx;
color: #999;
}
.broadcast-details .chat .item .text .name .return {
color: #509efb;
margin-left: 17rpx;
}
.broadcast-details .chat .item .text.textR .name .return {
margin: 0 0.17rem 0 0;
}
.broadcast-details .chat .item .text .conter {
background-color: #fff;
border-radius: 8rpx;
padding: 16rpx 20rpx;
font-size: 30rpx;
color: #333;
position: relative;
max-width: 496rpx;
margin-top: 2rpx;
}
.broadcast-details .chat .item .text .spot {
width: 15rpx;
height: 15rpx;
background-color: #c00000;
border-radius: 50%;
margin-left: 20rpx;
}
.broadcast-details .chat .item .text .conter:before {
position: absolute;
content: "";
width: 0;
height: 0;
border-bottom: 9rpx solid transparent;
border-right: 14rpx solid #fff;
border-top: 9rpx solid transparent;
left: -14rpx;
top: 25rpx;
}
.broadcast-details .chat .item .text.textR .conter:before {
left: unset;
right: -14rpx;
transform: rotateY(180deg);
}
.broadcast-details .chat .item .text .conter img {
width: 100%;
display: block;
}
.broadcast-details .chat .item .text .conter .signal {
width: 48rpx;
height: 48rpx;
}
.broadcast-details .chat .item .text .conter .signal.signalR {
transform: rotate(180deg);
-ms-transform: rotate(180deg);
-webkit-transform: rotate(180deg);
}
.broadcast-details .footerCon {
height: 100rpx;
width: 100%;
transition: all 0.005s cubic-bezier(0.25, 0.5, 0.5, 0.9);
background-color: #fff;
}
.broadcast-details .footerCon.on {
position: relative;
top: -300rpx;
transform: translate3d(0, 0, 0) !important;
}
.broadcast-details .footerCon .banner .swiper-slide {
flex-wrap: wrap;
-webkit-flex-wrap: wrap;
background-color: #fff;
padding-bottom: 50rpx;
border-top: 1px solid #f5f5f5;
}
.broadcast-details .footerCon .banner .swiper-slide .emoji-outer,
.swiper-slide .em {
display: block;
width: 50rpx;
height: 50rpx;
margin: 40rpx 0 0 50rpx;
}
.broadcast-details .footerCon .banner .swiper-container-horizontal>.swiper-pagination-bullets {
bottom: 10rpx;
}
.broadcast-details .footerCon .slider-banner .swiper-pagination-bullet-active {
background-color: #999;
}
.broadcast-details .recording {
width: 300rpx;
height: 300rpx;
position: fixed;
top: 40%;
left: 50%;
margin-left: -150rpx;
}
.broadcast-details .recording img {
width: 100%;
height: 100%;
}
.broadcast-details .footer {
width: 100%;
background-color: #fff;
padding: 17rpx 26rpx;
}
.broadcast-details .footer img {
width: 61rpx;
height: 60rpx;
display: block;
}
.broadcast-details .footer .input,
.broadcast-details .footer .voice {
width: 440rpx;
border-radius: 10rpx;
background-color: #e5e5e5;
/* padding: 17rpx 30rpx; */
height: 60rpx;
padding-left: 20rpx;
}
.input {}
.broadcast-details .footer .input {
max-height: 150rpx;
overflow-y: auto;
overflow-x: hidden;
}
.broadcast-details .footer .send {
width: 70rpx;
text-align: center;
height: 60rpx;
line-height: 60rpx;
font-weight: bold;
}
.em {
display: inline-block;
width: 50rpx;
height: 50rpx;
margin: 40rpx 0 0 50rpx;
}
.emoji-outer {
position: absolute;
right: 50rpx;
bottom: 30rpx;
width: 50rpx;
height: 50rpx;
}
.broadcast-details {
display: flex;
flex-direction: column;
width: 100%;
overflow: hidden;
.hd-wrapper {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
&.on{
padding-bottom: 300rpx;
}
}
}
</style>

View File

@@ -0,0 +1,80 @@
<template>
<div class="CustomerList">
<div
class="item acea-row row-between-wrapper"
v-for="item in list"
:key="item.id"
@click="goPage(item)"
>
<div class="pictrue"><img :src="item.avatar" /></div>
<div class="text line1">{{ item.nickname }}</div>
</div>
<home></home>
</div>
</template>
<script>
import { serviceList } from "@/api/user";
import home from '@/components/home';
export default {
name: "CustomerList",
components:{
home
},
data() {
return {
list: [],
productId: 0,
orderId: ""
};
},
methods: {
getList() {
serviceList().then(res => {
this.list = res.data;
});
},
goPage(item){
uni.navigateTo({
url:'/pages/customer_list/chat?uid='+item.uid+'&productId='+ this.productId+'&orderId='+this.orderId
})
}
},
onLoad(option) {
this.getList();
if (option.productId)
this.productId = option.productId;
if (option.orderId) {
this.orderId = option.orderId
}
}
};
</script>
<style scoped>
.CustomerList {
margin-top:13rpx;
}
.CustomerList .item {
height: 138rpx;
border-bottom: 1px solid #eee;
padding: 0 24rpx;
background-color: #fff;
}
.CustomerList .item .pictrue {
width: 90rpx;
height: 90rpx;
border-radius: 50%;
border: 3rpx solid #fff;
box-shadow: 0 0 1rpx 5rpx #f3f3f3;
}
.CustomerList .item .pictrue img {
width: 100%;
height: 100%;
border-radius: 50%;
}
.CustomerList .item .text {
width: 582rpx;
font-size: 32rpx;
color: #000;
}
</style>

View File

@@ -0,0 +1,94 @@
<template>
<view>
<view class='quality-recommend'>
<swipers :imgUrls="imgUrls"></swipers>
<view class='title acea-row row-center-wrapper'>
<view class='line'></view>
<view class='name'><text class='iconfont' :class="icon"></text>{{name}}</view>
<view class='line'></view>
</view>
<goodList :bastList="bastList" :status="status"></goodList>
</view>
<home></home>
</view>
</template>
<script>
import goodList from '@/components/goodList';
import home from '@/components/home';
import swipers from '@/components/swipers';
import { getGroomList } from '@/api/store.js';
export default {
components: {
goodList,
swipers,
home
},
data() {
return {
imgUrls: [],
bastList:[],
name:'',
icon:'',
type:0,
status:0
};
},
onLoad: function (options) {
this.type = options.type;
},
onShow: function () {
let type = this.type;
if (type == 1){
uni.setNavigationBarTitle({
title:"精品推荐"
});
this.name = '精品推荐';
this.icon = 'icon-jingpintuijian';
} else if (type == 2) {
uni.setNavigationBarTitle({
title:"热门榜单"
});
this.name = '热门榜单';
this.icon = 'icon-remen';
this.status = 1;
} else if (type == 3) {
uni.setNavigationBarTitle({
title:"首发新品"
});
this.name = '首发新品';
this.icon = 'icon-xinpin';
} else if (type == 4) {
uni.setNavigationBarTitle({
title:"促销单品"
});
this.name = '促销单品';
this.icon = 'icon-cuxiaoguanli';
}else{
uni.setNavigationBarTitle({
title:"首发新品"
});
this.name = '首发新品';
this.icon = 'icon-xinpin';
}
this.getIndexGroomList();
},
methods: {
getIndexGroomList: function () {
let that = this;
getGroomList(that.type).then(res=>{
that.imgUrls = res.data.banner;
that.$set(that,'bastList',res.data.list)
});
}
}
}
</script>
<style lang="scss">
page{background-color:#fff;}
.quality-recommend .title{height:120rpx;font-size:32rpx;color:#282828;background-color:#f5f5f5;}
.quality-recommend .title .line{width:230rpx;height:2rpx;background-color:#e9e9e9;}
.quality-recommend .title .name{margin:0 20rpx;}
.quality-recommend .title .name .iconfont{margin-right:13rpx;font-size:38rpx;vertical-align:-4rpx;color:#343434;}
</style>

View File

@@ -0,0 +1,263 @@
<template>
<view class='productSort'>
<view class='header acea-row row-center-wrapper'>
<view class='acea-row row-between-wrapper input'>
<text class='iconfont icon-sousuo'></text>
<input type='text' placeholder='点击搜索商品信息' @confirm="searchSubmitValue" confirm-type='search' name="search"
placeholder-class='placeholder'></input>
</view>
</view>
<view class='aside' :style="{bottom: tabbarH + 'px',height: height + 'rpx'}">
<scroll-view scroll-y="true" scroll-with-animation='true' style="height: 100%;">
<view class='item acea-row row-center-wrapper' :class='index==navActive?"on":""' v-for="(item,index) in productList"
:key="index" @click='tap(index,"b"+index)'><text>{{item.name}}</text></view>
</scroll-view>
</view>
<view class='conter'>
<scroll-view scroll-y="true" :scroll-into-view="toView" :style='"height:"+height+"rpx;margin-top: 126rpx;"' @scroll="scroll"
scroll-with-animation='true'>
<block v-for="(item,index) in productList" :key="index">
<view class='listw' :id="'b'+index">
<view class='title acea-row row-center-wrapper'>
<view class='line'></view>
<view class='name'>{{item.name}}</view>
<view class='line'></view>
</view>
<view class='list acea-row'>
<block v-for="(itemn,indexn) in item.child" :key="indexn">
<navigator hover-class='none' :url='"/pages/goods_list/index?cid="+itemn.id+"&title="+itemn.name' class='item acea-row row-column row-middle'>
<view class='picture' :style="{'background-color':itemn.extra?'none':'#f7f7f7'}" v-if="itemn.extra">
<image :src='itemn.extra'></image>
</view>
<view class='name line1'>{{itemn.name}}</view>
</navigator>
</block>
</view>
</view>
</block>
<view :style='"height:"+(height-300)+"rpx;"' v-if="number<15"></view>
</scroll-view>
</view>
</view>
</template>
<script>
import {
getCategoryList
} from '@/api/store.js';
import ClipboardJS from "@/plugin/clipboard/clipboard.js";
export default {
data() {
return {
navlist: [],
productList: [],
navActive: 0,
number: "",
height: 0,
hightArr: [],
toView: "",
tabbarH: 0
}
},
onLoad(options) {
this.getAllCategory();
},
onShow(){
},
methods: {
infoScroll: function() {
let that = this;
let len = that.productList.length;
let child = that.productList[len - 1]&&that.productList[len - 1].child?that.productList[len - 1].child:[];
this.number = child?child.length:0;
//设置商品列表高度
uni.getSystemInfo({
success: function(res) {
that.height = (res.windowHeight) * (750 / res.windowWidth) - 98;
},
});
let height = 0;
let hightArr = [];
for (let i = 0; i < len; i++) {
//获取元素所在位置
let query = uni.createSelectorQuery().in(this);
let idView = "#b" + i;
query.select(idView).boundingClientRect();
query.exec(function(res) {
let top = res[0].top;
hightArr.push(top);
that.hightArr = hightArr
});
};
},
tap(index, id) {
this.toView = id;
this.navActive = index;
console.log(this.navActive);
console.log(index);
},
getAllCategory: function() {
let that = this;
getCategoryList().then(res => {
that.productList = res.data;
setTimeout(function(){
that.infoScroll();
},500)
})
},
scroll: function(e) {
let scrollTop = e.detail.scrollTop;
let scrollArr = this.hightArr;
// for (let i = 0; i < scrollArr.length; i++) {
// if (scrollTop >= 0 && scrollTop < scrollArr[1] - scrollArr[0]) {
// this.navActive = 0
// } else if (scrollTop >= scrollArr[i] - scrollArr[0] && scrollTop < scrollArr[i + 1] - scrollArr[0]) {
// this.navActive = i
// } else if (scrollTop >= scrollArr[scrollArr.length - 1] - scrollArr[0]) {
// this.navActive = scrollArr.length - 1
// }
// }
},
searchSubmitValue: function(e) {
if (this.$util.trim(e.detail.value).length > 0)
uni.navigateTo({
url: '/pages/goods_list/index?searchValue=' + e.detail.value
})
else
return this.$util.Tips({
title: '请填写要搜索的产品信息'
});
},
}
}
</script>
<style scoped lang="scss">
.productSort .header {
margin-top:var(--status-bar-height);
height: 78rpx;
background-color: #fff;
position: fixed;
left: 0;
right: 0;
top: 0;
z-index: 9;
border-bottom: 1rpx solid #f5f5f5;
}
.productSort .header .input {
width: 700rpx;
height: 60rpx;
background-color: #f5f5f5;
border-radius: 50rpx;
box-sizing: border-box;
padding: 0 25rpx;
}
.productSort .header .input .iconfont {
font-size: 26rpx;
color: #555;
}
.productSort .header .input .placeholder {
color: #999;
}
.productSort .header .input input {
font-size: 26rpx;
height: 100%;
width: 597rpx;
}
.productSort .aside {
position: fixed;
width: 180rpx;
left: 0;
top:0;
background-color: #f7f7f7;
overflow-y: scroll;
overflow-x: hidden;
height: auto;
margin-top: 126rpx;
}
.productSort .aside .item {
height: 100rpx;
width: 100%;
font-size: 26rpx;
color: #424242;
}
.productSort .aside .item.on {
background-color: #fff;
border-left: 4rpx solid #fc4141;
width: 100%;
text-align: center;
color: #fc4141;
font-weight: bold;
}
.productSort .conter {
margin: 126rpx 0 0 180rpx;
padding: 0 14rpx;
background-color: #fff;
}
.productSort .conter .listw {
padding-top: 20rpx;
}
.productSort .conter .listw .title {
height: 90rpx;
}
.productSort .conter .listw .title .line {
width: 100rpx;
height: 2rpx;
background-color: #f0f0f0;
}
.productSort .conter .listw .title .name {
font-size: 28rpx;
color: #333;
margin: 0 30rpx;
font-weight: bold;
}
.productSort .conter .list {
flex-wrap: wrap;
}
.productSort .conter .list .item {
width: 177rpx;
margin-top: 26rpx;
}
.productSort .conter .list .item .picture {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
}
.productSort .conter .list .item .picture image {
width: 100%;
height: 100%;
border-radius: 50%;
div{
background-color: #f7f7f7;
}
}
.productSort .conter .list .item .name {
font-size: 24rpx;
color: #333;
height: 56rpx;
line-height: 56rpx;
width: 120rpx;
text-align: center;
}
</style>

File diff suppressed because one or more lines are too long

442
pages/goods_list/index.vue Normal file
View File

@@ -0,0 +1,442 @@
<template>
<view>
<view class='productList'>
<view class='search bg-color acea-row row-between-wrapper'>
<!-- #ifdef H5 -->
<view class="iconfont icon-xiangzuo" @click="goback()"></view>
<!-- #endif -->
<view class='input acea-row row-between-wrapper'><text class='iconfont icon-sousuo'></text>
<input placeholder='搜索商品名称' placeholder-class='placeholder' confirm-type='search' name="search"
:value='where.keyword' @confirm="searchSubmit"></input>
</view>
<view class='iconfont' :class='is_switch==true?"icon-pailie":"icon-tupianpailie"' @click='Changswitch'>
</view>
</view>
<view class='nav acea-row row-middle'>
<view class='item' :class='title ? "font-color":""' @click='set_where(1)'>{{title ? title:'默认'}}</view>
<view class='item' @click='set_where(2)'>
价格
<image v-if="price==1" src='../../static/images/up.png'></image>
<image v-else-if="price==2" src='../../static/images/down.png'></image>
<image v-else src='../../static/images/horn.png'></image>
</view>
<view class='item' @click='set_where(3)'>
销量
<image v-if="stock==1" src='../../static/images/up.png'></image>
<image v-else-if="stock==2" src='../../static/images/down.png'></image>
<image v-else src='../../static/images/horn.png'></image>
</view>
<!-- down -->
<view class='item' :class='nows ? "font-color":""' @click='set_where(4)'>新品</view>
</view>
<view :class='is_switch==true?"":"listBox"' v-if="productList.length>0">
<view class='list acea-row row-between-wrapper' :class='is_switch==true?"":"on"'>
<view class='item' :class='is_switch==true?"":"on"' hover-class='none'
v-for="(item,index) in productList" :key="index" @click="godDetail(item)">
<view class='pictrue' :class='is_switch==true?"":"on"'>
<image :src='item.image' :class='is_switch==true?"":"on"'></image>
<span class="pictrue_log_class"
:class="is_switch === true ? 'pictrue_log_big' : 'pictrue_log'"
v-if="item.activityH5 && item.activityH5.type === '1'">秒杀</span>
<span class="pictrue_log_class"
:class="is_switch === true ? 'pictrue_log_big' : 'pictrue_log'"
v-if="item.activityH5 && item.activityH5.type === '2'">砍价</span>
<span class="pictrue_log_class"
:class="is_switch === true ? 'pictrue_log_big' : 'pictrue_log'"
v-if="item.activityH5 && item.activityH5.type === '3'">拼团</span>
</view>
<view class='text' :class='is_switch==true?"":"on"'>
<view class='name line1'>{{item.storeName}}</view>
<view class='money font-color' :class='is_switch==true?"":"on"'>
<!-- <text
class='num'>{{item.price}}</text>
<text style="margin-left: 30rpx;font-weight: 500;color: #999;text-decoration: line-through;">{{ item.otPrice }}</text> -->
<view style="font-size: 30rpx;font-weight: bold;">市场价{{ item.otPrice }}</view>
<view style="color: #000;font-size: 24rpx;">供货价{{ item.price }}</view>
</view>
<view class='vip acea-row row-between-wrapper' :class='is_switch==true?"":"on"'>
<view class='vip-money' v-if="item.vip_price && item.vip_price > 0">{{item.vip_price}}
<image src='../../static/images/vip.png'></image>
</view>
<view>已售{{Number(item.sales) + Number(item.ficti) || 0}}{{item.unitName}}</view>
</view>
</view>
</view>
</view>
<view class='loadingicon acea-row row-center-wrapper' v-if='productList.length > 0'>
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view>
</view>
</view>
<view class='noCommodity' v-if="productList.length==0 && where.page > 1">
<view class='pictrue'>
<image src='../../static/images/noShopper.png'></image>
</view>
<recommend :hostProduct="hostProduct"></recommend>
</view>
</view>
</template>
<script>
import {
getProductslist,
getProductHot
} from '@/api/store.js';
import recommend from '@/components/recommend';
import {
mapGetters
} from "vuex";
import {
goShopDetail
} from '@/libs/order.js'
export default {
computed: mapGetters(['uid']),
components: {
recommend
},
data() {
return {
productList: [],
is_switch: true,
where: {
keyword: '',
priceOrder: '',
salesOrder: '',
news: 0,
page: 1,
limit: 20,
cid: 0,
},
price: 0,
stock: 0,
nows: false,
loadend: false,
loading: false,
loadTitle: '加载更多',
title: '',
hostProduct: [],
hotPage: 1,
hotLimit: 10,
hotScroll: false
};
},
onLoad: function(options) {
this.$set(this.where, 'cid', options.cid || 0);
this.title = options.title || '';
this.$set(this.where, 'keyword', options.searchValue || '');
this.get_product_list();
},
methods: {
goback() {
// #ifdef H5
return history.back();
// #endif
// #ifndef H5
return uni.navigateBack({
delta: 1,
})
// #endif
},
// 去详情页
godDetail(item) {
goShopDetail(item, this.uid).then(res => {
uni.navigateTo({
url: `/pages/goods_details/index?id=${item.id}`
})
})
},
Changswitch: function() {
let that = this;
that.is_switch = !that.is_switch
},
searchSubmit: function(e) {
let that = this;
that.$set(that.where, 'keyword', e.detail.value);
that.loadend = false;
that.$set(that.where, 'page', 1)
this.get_product_list(true);
},
/**
* 获取我的推荐
*/
get_host_product: function() {
let that = this;
if (that.hotScroll) return
getProductHot(
that.hotPage,
that.hotLimit,
).then(res => {
that.hotPage++
that.hotScroll = res.data.list.length < that.hotLimit
that.hostProduct = that.hostProduct.concat(res.data.list)
// that.$set(that, 'hostProduct', res.data)
});
},
//点击事件处理
set_where: function(e) {
switch (e) {
case 1:
return;
break;
case 2:
if (this.price == 0) this.price = 1;
else if (this.price == 1) this.price = 2;
else if (this.price == 2) this.price = 0;
this.stock = 0;
break;
case 3:
if (this.stock == 0) this.stock = 1;
else if (this.stock == 1) this.stock = 2;
else if (this.stock == 2) this.stock = 0;
this.price = 0
break;
case 4:
this.nows = !this.nows;
break;
}
this.loadend = false;
this.$set(this.where, 'page', 1);
this.get_product_list(true);
},
//设置where条件
setWhere: function() {
if (this.price == 0) this.where.priceOrder = '';
else if (this.price == 1) this.where.priceOrder = 'asc';
else if (this.price == 2) this.where.priceOrder = 'desc';
if (this.stock == 0) this.where.salesOrder = '';
else if (this.stock == 1) this.where.salesOrder = 'asc';
else if (this.stock == 2) this.where.salesOrder = 'desc';
this.where.news = this.nows ? 1 : 0;
},
//查找产品
get_product_list: function(isPage) {
let that = this;
that.setWhere();
if (that.loadend) return;
if (that.loading) return;
if (isPage === true) that.$set(that, 'productList', []);
that.loading = true;
that.loadTitle = '';
getProductslist(that.where).then(res => {
let list = res.data.list;
let productList = that.$util.SplitArray(list, that.productList);
let loadend = list.length < that.where.limit;
that.loadend = loadend;
that.loading = false;
that.loadTitle = loadend ? '已全部加载' : '加载更多';
that.$set(that, 'productList', productList);
that.$set(that.where, 'page', that.where.page + 1);
if (that.productList.length === 0) {
this.get_host_product();
}
}).catch(err => {
that.loading = false;
that.loadTitle = '加载更多';
});
},
},
onPullDownRefresh() {
},
onReachBottom() {
if (this.productList.length > 0) {
this.get_product_list();
} else {
this.get_host_product();
}
}
}
</script>
<style scoped lang="scss">
.iconfont {
color: #fff;
}
.listBox{
padding: 20px 15px;
margin-top: 154rpx;
}
.productList .search {
width: 100%;
height: 86rpx;
padding-left: 23rpx;
box-sizing: border-box;
position: fixed;
left: 0;
top: 0;
z-index: 9;
}
.productList .search .input {
// width: 640rpx;
height: 60rpx;
background-color: #fff;
border-radius: 50rpx;
padding: 0 20rpx;
box-sizing: border-box;
}
.productList .search .input input {
/* #ifdef H5 */
width: 528rpx;
/* #endif */
/* #ifndef H5 */
width: 548rpx;
/* #endif */
height: 100%;
font-size: 26rpx;
}
.productList .search .input .placeholder {
color: #999;
}
.productList .search .input .iconfont {
font-size: 35rpx;
color: #555;
}
.productList .search .icon-pailie,
.productList .search .icon-tupianpailie {
color: #fff;
width: 62rpx;
font-size: 40rpx;
height: 86rpx;
line-height: 86rpx;
}
.productList .nav {
height: 86rpx;
color: #454545;
position: fixed;
left: 0;
width: 100%;
font-size: 28rpx;
background-color: #fff;
margin-top: 86rpx;
top: 0;
z-index: 9;
}
.productList .nav .item {
width: 25%;
text-align: center;
}
.productList .nav .item.font-color {
font-weight: bold;
}
.productList .nav .item image {
width: 15rpx;
height: 19rpx;
margin-left: 10rpx;
}
.productList .list {
padding: 0 30rpx;
margin-top: 192rpx;
}
.productList .list.on {
border-radius: 14rpx;
margin-top: 0 !important;
background-color: #fff;
padding: 40rpx 0 0 0;
// margin: 20rpx 0;
// background-color: #fff;
}
.productList .list .item {
width: 335rpx;
background-color: #fff;
border-radius: 14rpx;
margin-bottom: 20rpx;
}
.productList .list .item.on {
width: 100%;
display: flex;
padding: 0 24rpx 50rpx 24rpx;
margin: 0;
border-radius: 14rpx;
}
.productList .list .item .pictrue {
position: relative;
width: 100%;
height: 335rpx;
}
.productList .list .item .pictrue.on {
width: 180rpx;
height: 180rpx;
}
.productList .list .item .pictrue image {
width: 100%;
height: 100%;
border-radius: 20rpx 20rpx 0 0;
}
.productList .list .item .pictrue image.on {
border-radius: 6rpx;
}
.productList .list .item .text {
padding: 18rpx 20rpx;
font-size: 30rpx;
color: #222;
}
.productList .list .item .text.on {
width: 456rpx;
padding: 0 0 0 20rpx;
}
.productList .list .item .text .money {
font-size: 26rpx;
font-weight: bold;
margin-top: 8rpx;
}
.productList .list .item .text .money.on {
margin-top: 50rpx;
}
.productList .list .item .text .money .num {
font-size: 34rpx;
}
.productList .list .item .text .vip {
font-size: 22rpx;
color: #aaa;
margin-top: 7rpx;
}
.productList .list .item .text .vip.on {
margin-top: 12rpx;
}
.productList .list .item .text .vip .vip-money {
font-size: 24rpx;
color: #282828;
font-weight: bold;
}
.productList .list .item .text .vip .vip-money image {
width: 46rpx;
height: 21rpx;
margin-left: 4rpx;
}
.noCommodity {
background-color: #fff;
padding-bottom: 30rpx;
margin-top: 172rpx;
}
</style>

View File

@@ -0,0 +1,223 @@
<template>
<view>
<view class='searchGood'>
<view class='search acea-row row-between-wrapper'>
<view class='input acea-row row-between-wrapper'>
<text class='iconfont icon-sousuo2'></text>
<input type='text' :value='searchValue' :focus="focus" placeholder='点击搜索商品' placeholder-class='placeholder' @input="setValue"></input>
</view>
<view class='bnt' @tap='searchBut'>搜索</view>
</view>
<view class='title'>热门搜索</view>
<view class='list acea-row'>
<block v-for="(item,index) in hotSearchList" :key="index">
<view class='item' @tap='setHotSearchValue(item.title)'>{{item.title}}</view>
</block>
</view>
<view class='line'></view>
<goodList :bastList="bastList" v-if="bastList.length > 0"></goodList>
<view class='loadingicon acea-row row-center-wrapper' v-if="bastList.length > 0">
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view>
</view>
<view class='noCommodity'>
<view class='pictrue' v-if="bastList.length == 0 && isbastList">
<image src='../../static/images/noSearch.png'></image>
</view>
<recommend :hostProduct='hostProduct' v-if="bastList.length == 0"></recommend>
</view>
</view>
</template>
<script>
import {
getSearchKeyword,
getProductslist,
getProductHot
} from '@/api/store.js';
import goodList from '@/components/goodList';
import recommend from '@/components/recommend';
export default {
components: {
goodList,
recommend
},
data() {
return {
hostProduct: [],
searchValue: '',
focus: true,
bastList: [],
hotSearchList: [],
first: 0,
limit: 8,
page: 1,
loading: false,
loadend: false,
loadTitle: '加载更多',
hotPage:1,
isScroll:true,
isbastList: false
};
},
onShow: function() {
this.getRoutineHotSearch();
this.getHostProduct();
},
onReachBottom: function() {
if(this.bastList.length>0){
this.getProductList();
}else{
this.getHostProduct();
}
},
methods: {
getRoutineHotSearch: function() {
let that = this;
getSearchKeyword().then(res => {
that.$set(that, 'hotSearchList', res.data);
});
},
getProductList: function() {
let that = this;
if (that.loadend) return;
if (that.loading) return;
that.loading = true;
that.loadTitle = '';
getProductslist({
keyword: that.searchValue,
page: that.page,
limit: that.limit
}).then(res => {
let list = res.data.list,
loadend = list.length < that.limit;
that.bastList = that.$util.SplitArray(list, that.bastList);
that.$set(that,'bastList',that.bastList);
that.loading = false;
that.loadend = loadend;
that.loadTitle = loadend ? "😕人家是有底线的~~" : "加载更多";
that.page = that.page + 1;
that.isbastList = true;
}).catch(err => {
that.loading = false,
that.loadTitle = '加载更多'
});
},
getHostProduct: function() {
let that = this;
if(!this.isScroll) return
getProductHot(that.hotPage,that.limit).then(res => {
that.isScroll = res.data.list.length>=that.limit
that.hostProduct = that.hostProduct.concat(res.data.list)
that.hotPage += 1;
});
},
setHotSearchValue: function(event) {
this.$set(this, 'searchValue', event);
this.page = 1;
this.loadend = false;
this.$set(this, 'bastList', []);
this.getProductList();
},
setValue: function(event) {
this.$set(this, 'searchValue', event.detail.value);
},
searchBut: function() {
let that = this;
that.focus = false;
if (that.searchValue.length > 0) {
that.page = 1;
that.loadend = false;
that.$set(that, 'bastList', []);
uni.showLoading({
title: '正在搜索中'
});
that.getProductList();
uni.hideLoading();
} else {
return this.$util.Tips({
title: '请输入要搜索的商品',
icon: 'none',
duration: 1000,
mask: true,
});
}
}
}
}
</script>
<style lang="scss">
page {
margin-top: var(--status-bar-height);
background-color: #fff !important;
}
.searchGood .search {
padding-left: 30rpx;
background-color: #fff !important;
}
.searchGood .search {
padding-top: 20rpx;
}
.searchGood .search .input {
width: 598rpx;
background-color: #f7f7f7;
border-radius: 33rpx;
padding: 0 35rpx;
box-sizing: border-box;
height: 66rpx;
}
.searchGood .search .input input {
width: 472rpx;
font-size: 26rpx;
}
.searchGood .search .input .placeholder {
color: #bbb;
}
.searchGood .search .input .iconfont {
color: #000;
font-size: 35rpx;
}
.searchGood .search .bnt {
width: 120rpx;
text-align: center;
height: 66rpx;
line-height: 66rpx;
font-size: 30rpx;
color: #282828;
}
.searchGood .title {
font-size: 28rpx;
color: #999;
margin: 50rpx 30rpx 25rpx 30rpx;
}
.searchGood .list {
padding-left: 10rpx;
}
.searchGood .list .item {
font-size: 26rpx;
color: #454545;
padding: 0 21rpx;
height: 60rpx;
border-radius: 30rpx;
line-height: 60rpx;
border: 1rpx solid #aaa;
margin: 0 0 20rpx 20rpx;
}
.searchGood .line {
border-bottom: 1rpx solid #eee;
margin: 20rpx 30rpx 0 30rpx;
}
</style>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,266 @@
<template>
<view :class="{borderShow:isBorader}">
<view class="combination" v-if="combinationList.length">
<view class="title acea-row row-between">
<view class="spike-bd">
<view v-if="assistUserList.length > 0" class="activity_pic">
<view v-for="(item,index) in assistUserList" :key="index" class="picture"
:style='index===2?"position: relative":"position: static"'>
<span class="avatar" :style='"background-image: url("+item+")"'></span>
<span v-if="index===2 && Number(assistUserCount) > 3" class="mengceng">
<i>···</i>
</span>
</view>
<text class="pic_count">{{assistUserCount}}人参与</text>
</view>
</view>
<navigator url="/pages/activity/goods_combination/index" hover-class="none"
class="more acea-row row-center-wrapper">GO<text class="iconfont icon-xiangyou"></text></navigator>
</view>
<view class="conter acea-row">
<scroll-view scroll-x="true" style="white-space: nowrap; vertical-align: middle;"
show-scrollbar="false">
<view class="itemCon" v-for="(item, index) in combinationList" :key="index" @click="goDetail(item)">
<view class="item">
<view class="pictrue">
<image :src="item.image"></image>
</view>
<view class="text lines1">
<view class="name line1">{{item.title}}</view>
<view class="money">¥<text class="num">{{item.price}}</text></view>
<view class="y_money">¥{{item.otPrice}}</view>
</view>
</view>
</view>
<!-- <navigator :url="`/pages/activity/goods_combination_details/index?id=${item.id}`" hover-class="none" class="item" v-for="(item, index) in combinationList" :key="index">
<view class="pictrue">
<image :src="item.image"></image>
</view>
<view class="text lines1">
<text class="money">¥<text class="num">{{item.price}}</text></text>
<text class="y_money">¥{{item.otPrice}}</text>
</view>
</navigator> -->
</scroll-view>
</view>
</view>
</view>
</template>
<script>
let app = getApp();
import {
getCombinationIndexApi
} from '@/api/activity.js';
export default {
name: 'b_combination',
data() {
return {
combinationList: [],
isBorader: false,
assistUserList: [],
assistUserCount: 0
};
},
created() {
this.getCombinationList();
},
mounted() {},
methods: {
// 拼团列表
getCombinationList: function() {
let that = this;
getCombinationIndexApi().then(function(res) {
that.combinationList = res.data.productList;
that.assistUserList = res.data.avatarList;
that.assistUserCount = res.data.totalPeople;
}).catch((res) => {
return that.$util.Tips({
title: res
});
})
},
goDetail(item) {
uni.navigateTo({
url: `/pages/activity/goods_combination_details/index?id=${item.id}`
})
}
}
}
</script>
<style lang="scss" scoped>
.mengceng {
width: 38rpx;
height: 38rpx;
line-height: 36rpx;
background: rgba(51, 51, 51, 0.6);
text-align: center;
border-radius: 50%;
opacity: 1;
position: absolute;
left: 0px;
top: 2rpx;
color: #FFF;
i{
font-style: normal;
font-size: 20rpx;
}
}
.activity_pic {
margin-left: 28rpx;
padding-left: 20rpx;
.picture {
display: inline-block;
}
.avatar {
width: 38rpx;
height: 38rpx;
display: inline-table;
vertical-align: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
border-radius: 50%;
background-repeat: no-repeat;
background-size: cover;
background-position: 0 0;
margin-right: -10rpx;
box-shadow: 0 0 0 1px #fff;
}
.pic_count {
margin-left: 30rpx;
color: $theme-color;
font-size: 22rpx;
font-weight: 500;
}
}
.default {
width: 690rpx;
height: 300rpx;
border-radius: 14rpx;
margin: 26rpx auto 0 auto;
background-color: #ccc;
text-align: center;
line-height: 300rpx;
.iconfont {
font-size: 80rpx;
}
}
.combination {
width: auto;
background-color: #fff;
border-radius: 14rpx;
margin: 0 auto 30rpx auto;
padding: 16rpx 24rpx 24rpx 24rpx;
background-image: url(../../../static/images/pth.png);
background-repeat: no-repeat;
background-size: 100%;
.title {
width: 80%;
margin-left: 128rpx;
.sign {
width: 40rpx;
height: 40rpx;
image {
width: 100%;
height: 100%;
}
}
.name {
font-size: 32rpx;
color: #282828;
margin-left: 12rpx;
font-weight: bold;
text {
color: #797979;
font-size: 24rpx;
font-weight: 400;
margin-left: 14rpx;
}
}
.more {
width: 86rpx;
height: 40rpx;
background: linear-gradient(142deg, #FFE9CE 0%, #FFD6A7 100%);
opacity: 1;
border-radius: 18px;
font-size: 22rpx;
color: #FE960F;
padding-left: 8rpx;
font-weight: 800;
.iconfont {
font-size: 21rpx;
}
}
}
.conter {
margin-top: 24rpx;
.itemCon {
display: inline-block;
width: 220rpx;
margin-right: 24rpx;
}
.item {
width: 100%;
.pictrue {
width: 100%;
height: 220rpx;
border-radius: 6rpx;
image {
width: 100%;
height: 100%;
border-radius: 6rpx;
}
}
.text {
margin-top: 4rpx;
.y_money {
font-size: 24rpx;
color: #999999;
text-decoration: line-through;
}
.name {
font-size: 24rpx;
color: #000;
margin-top: 14rpx;
}
.money {
color: #FD502F;
font-size: 28rpx;
height: 100%;
font-weight: bold;
margin: 10rpx 0 0rpx 0;
.num {
font-size: 28rpx;
}
}
}
}
}
}
</style>

View File

@@ -0,0 +1,189 @@
<template>
<view :class="{borderShow:isBorader}">
<view class="combination" v-if="bargList.length">
<view class="title acea-row row-between">
<view class="acea-row row-column">
<image src="../../../static/images/kanjia.png" class="pic"></image>
</view>
<navigator url="/pages/activity/goods_bargain/index" hover-class="none" class="more acea-row row-center-wrapper">GO<text class="iconfont icon-xiangyou"></text></navigator>
</view>
<view class="conter acea-row">
<scroll-view scroll-x="true" style="white-space: nowrap; vertical-align: middle;" show-scrollbar="false">
<view class="itemCon" v-for="(item, index) in bargList" :key="index" @click="bargDetail(item)">
<view class="item">
<view class="pictrue">
<image :src="item.image"></image>
</view>
<view class="text lines1">
<view class="name line1">{{item.title}}</view>
<view class="money">¥<text class="num">{{item.minPrice}}</text></view>
<view class="btn">参与砍价</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
</template>
<script>
let app = getApp();
import {
toLogin
} from '@/libs/login.js';
import {
getBargainIndexApi
} from '@/api/activity.js';
import { mapGetters } from 'vuex';
export default {
name: 'c_bargain',
computed: mapGetters({
'userData': 'userInfo',
'uid': 'uid'
}),
data() {
return {
bargList: [],
isBorader:false
};
},
created() {
this.getBargainList();
},
mounted() {
},
methods: {
// 砍价列表
getBargainList() {
getBargainIndexApi().then(res => {
this.bargList = res.data ? res.data.productList : [];
})
},
bargDetail(item){
uni.navigateTo({
url: `/pages/activity/goods_bargain_details/index?id=${item.id}&startBargainUid=${this.uid}`
});
}
}
}
</script>
<style lang="scss" scoped>
.pic{
width: 130rpx;
height: 30rpx;
}
.default{
width: 690rpx;
height: 300rpx;
border-radius: 14rpx;
margin: 26rpx auto 0 auto;
background-color: #ccc;
text-align: center;
line-height: 300rpx;
.iconfont{
font-size: 80rpx;
}
}
.combination{
width: auto;
background-image: url(../../../static/images/kjbj.png);
background-repeat: no-repeat;
background-size: 100%;
background-color: #fff;
border-radius: 14rpx;
margin: 30rpx auto 0 auto;
padding: 25rpx 20rpx 25rpx 20rpx;
.title {
.sign {
font-size: 32rpx;
color: $theme-color;
margin-bottom: 2rpx;
font-weight: bold;
margin-bottom: 10rpx;
}
.name {
text {
color: #333333;
font-size: 26rpx;
font-weight: 400;
}
}
.more {
width: 86rpx;
height: 40rpx;
background: linear-gradient(142deg, #FFE9CE 0%, #FFD6A7 100%);
opacity: 1;
border-radius: 18px;
font-size: 22rpx;
color: #FE960F;
padding-left: 8rpx;
font-weight: 800;
.iconfont {
font-size: 21rpx;
}
}
}
.conter{
margin-top: 28rpx;
.itemCon {
display: inline-block;
width: 220rpx;
margin-right: 24rpx;
}
.item{
width:100%;
.pictrue{
width: 100%;
height: 220rpx;
border-radius: 6rpx;
image{
width: 100%;
height: 100%;
border-radius: 6rpx;
}
}
.text{
margin-top: 4rpx;
.y_money {
font-size: 24rpx;
color: #999999;
text-decoration: line-through;
}
.name {
font-size: 24rpx;
color: #000;
margin-top: 14rpx;
}
.money {
color: #FD502F;
font-size: 28rpx;
height: 100%;
font-weight: bold;
margin: 10rpx 0;
.num {
font-size: 28rpx;
}
}
.btn{
width: 220rpx;
height: 48rpx;
line-height: 48rpx;
text-align: center;
background: linear-gradient(129deg, #FF5555 0%, #FF0000 100%);
opacity: 1;
border-radius: 0px 0px 14rpx 14rpx;
color: #FFFFFF;
font-size: 26rpx;
margin-top: 6rpx;
}
}
}
}
}
</style>

1372
pages/index/index.vue Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,275 @@
<template>
<view>
<view class='newsDetail'>
<view class='title'>{{articleInfo.title}}</view>
<view class='list acea-row row-middle'>
<view class='label'>{{articleInfo.author}}</view>
<view class='item'></text>{{articleInfo.createTime}}</view>
<view class='item'><text class='iconfont icon-liulan'></text>{{articleInfo.visit}}</view>
</view>
<view class='conters'>
<jyf-parser :html="content" ref="article" :tag-style="tagStyle"></jyf-parser>
</view>
<view class="picTxt acea-row row-between-wrapper" v-if="store_info.id">
<view class="pictrue">
<image :src="store_info.image"></image>
</view>
<view class="text">
<view class="name line1">{{store_info.storeName}}</view>
<view class="money font-color">
<text class="num">{{store_info.price}}</text>
</view>
<view class="y_money">{{store_info.otPrice}}</view>
</view>
<navigator :url="'/pages/goods_details/index?id='+store_info.id" hover-class="none" class="label"><text class="span">查看商品</text></navigator>
</view>
<!-- #ifdef H5 -->
<button class="bnt bg-color" hover-class='none' @click="listenerActionSheet" v-if="this.$wechat.isWeixin()">和好友一起分享</button>
<!-- #endif -->
<!-- #ifdef MP -->
<button class="bnt bg-color" open-type="share" hover-class='none'>和好友一起分享</button>
<!-- #endif -->
</view>
<shareInfo @setShareInfoStatus="setShareInfoStatus" :shareInfoStatus="shareInfoStatus"></shareInfo>
<home></home>
</view>
</template>
<script>
import {
getArticleDetails
} from '@/api/api.js';
import {
getProductDetail
} from '@/api/store.js';
import shareInfo from '@/components/shareInfo';
import home from '@/components/home';
import parser from "@/components/jyf-parser/jyf-parser";
export default {
components: {
shareInfo,
home,
"jyf-parser": parser
},
data() {
return {
id: 0,
articleInfo: [],
store_info: {},
content:'',
shareInfoStatus:false,
tagStyle: {
img: 'width:100%;'
},
productId: 0
};
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (options.hasOwnProperty('id')){
this.id = options.id;
}else{
// #ifndef H5
uni.navigateBack({delta: 1 });
// #endif
// #ifdef H5
history.back();
// #endif
}
},
onShow: function () {
this.getArticleOne();
},
/**
* 用户点击右上角分享
*/
// #ifdef MP
onShareAppMessage: function() {
return {
title: this.articleInfo.title,
imageUrl: this.articleInfo.imageInput.length ? this.articleInfo.imageInput[0] : "",
desc: this.articleInfo.synopsis,
path: '/pages/news_details/index?id=' + this.id
};
},
// #endif
methods: {
getArticleOne:function(){
let that = this;
getArticleDetails({id:that.id}).then(res=>{
uni.setNavigationBarTitle({
title:res.data.title.substring(0,7) + "..."
});
that.$set(that,'articleInfo',res.data);
that.$set(that,'productId',res.data.productId);
if(res.data.productId){
that.goodInfo(res.data.productId);
}
that.content = res.data.content;
// #ifdef H5
if(this.$wechat.isWeixin()){
this.setShareInfo();
}
// #endif
});
},
goodInfo(id){
getProductDetail(id).then(res=>{
this.$set(this,'store_info',res.data.storeInfo?res.data.storeInfo:{});
})
},
listenerActionSheet(){
this.shareInfoStatus = true
},
setShareInfoStatus(){
this.shareInfoStatus = false
},
setShareInfo: function() {
let href = location.href;
let configAppMessage = {
desc: this.articleInfo.synopsis,
title: this.articleInfo.title,
link: href,
imgUrl: this.articleInfo.imageInput.length ? this.articleInfo.imageInput[0] : ""
};
this.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], configAppMessage);
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #fff !important;
}
.newsDetail{
padding: 30rpx 0;
}
.newsDetail .title {
padding: 0 30rpx;
font-size: 34rpx;
color: #282828;
font-weight: bold;
line-height: 1.5;
}
.newsDetail .list {
margin: 28rpx 30rpx 0 30rpx;
padding-bottom: 25rpx;
}
.newsDetail .list .label {
font-size: 30rpx;
color: #B1B2B3;
}
.newsDetail .list .item {
margin-left: 27rpx;
font-size: 30rpx;
color: #B1B2B3;
}
.newsDetail .list .item .iconfont {
font-size: 28rpx;
margin-right: 10rpx;
}
.newsDetail .list .item .iconfont.icon-shenhezhong {
font-size: 26rpx;
}
.newsDetail .conters {
padding: 0 30rpx;
font-size: 32rpx;
color: #8A8B8C;
line-height: 1.7;
}
.newsDetail .picTxt {
width: 690rpx;
height: 200rpx;
border-radius: 20rpx;
border: 1px solid #e1e1e1;
position: relative;
margin: 30rpx auto 0 auto;
}
.newsDetail .picTxt .pictrue {
width: 200rpx;
height: 200rpx;
}
.newsDetail .picTxt .pictrue image {
width: 100%;
height: 100%;
border-radius: 20rpx 0 0 20rpx;
display: block;
}
.newsDetail .picTxt .text {
width: 460rpx;
}
.newsDetail .picTxt .text .name {
font-size: 30rpx;
color: #282828;
}
.newsDetail .picTxt .text .money {
font-size: 24rpx;
margin-top: 40rpx;
font-weight: bold;
}
.newsDetail .picTxt .text .money .num {
font-size: 36rpx;
}
.newsDetail .picTxt .text .y_money {
font-size: 26rpx;
color: #999;
text-decoration: line-through;
}
.newsDetail .picTxt .label {
position: absolute;
background-color: #303131;
width: 160rpx;
height: 50rpx;
right: -7rpx;
border-radius: 25rpx 0 6rpx 25rpx;
text-align: center;
line-height: 50rpx;
bottom: 24rpx;
}
.newsDetail .picTxt .label .span {
background-image: linear-gradient(to right, #fff71e 0%, #f9b513 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.newsDetail .picTxt .label:after {
content: " ";
position: absolute;
width: 0;
height: 0;
border-bottom: 8rpx solid #303131;
border-right: 8rpx solid transparent;
top: -7rpx;
right: 0;
}
.newsDetail .bnt {
color: #fff;
font-size: 30rpx;
width: 690rpx;
height: 90rpx;
border-radius: 45rpx;
margin: 48rpx auto;
text-align: center;
line-height: 90rpx;
}
</style>

289
pages/news_list/index.vue Normal file
View File

@@ -0,0 +1,289 @@
<template>
<view>
<view class='newsList'>
<view class='swiper' v-if="imgUrls.length > 0">
<swiper indicator-dots="true" :autoplay="autoplay" :circular="circular" :interval="interval" :duration="duration"
indicator-color="rgba(102,102,102,0.3)" indicator-active-color="#666">
<block v-for="(item,index) in imgUrls" :key="index">
<swiper-item>
<navigator :url="'/pages/news_details/index?id='+item.id">
<image :src="item.imageInput" class="slide-image" />
</navigator>
</swiper-item>
</block>
</swiper>
</view>
<view class='nav' v-if="navList.length > 0">
<scroll-view class="scroll-view_x" scroll-x scroll-with-animation :scroll-left="scrollLeft" style="width:auto;overflow:hidden;">
<block v-for="(item,index) in navList" :key="index">
<view class='item borRadius14' :class='active==item.id?"on":""' @click='tabSelect(item.id, index)'>
<view>{{item.name}}</view>
<view class='line bg-color' v-if="active==item.id"></view>
</view>
</block>
</scroll-view>
</view>
<view class='list'>
<block v-for="(item,index) in articleList" :key="index">
<navigator :url='"/pages/news_details/index?id="+item.id' hover-class='none' class='item acea-row row-between-wrapper'>
<view class='text acea-row row-column-between'>
<view class='name line2'>{{item.title}}</view>
<view>{{item.createTime}}</view>
</view>
<view class='pictrue'>
<image :src='item.imageInput'></image>
</view>
</navigator>
</block>
</view>
</view>
<view class='noCommodity' v-if="articleList.length == 0 && (page != 1 || active== 0)">
<view class='pictrue'>
<image src='../../static/images/noNews.png'></image>
</view>
</view>
<home></home>
</view>
</template>
<script>
import {
getArticleCategoryList,
getArticleList,
getArticleHotList,
getArticleBannerList
} from '@/api/api.js';
import home from '@/components/home';
export default {
components: {
home
},
data() {
return {
imgUrls: [],
articleList: [],
indicatorDots: false,
circular: true,
autoplay: true,
interval: 3000,
duration: 500,
navList: [],
active: 0,
page: 1,
limit: 8,
status: false,
scrollLeft: 0
};
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.getArticleHot();
this.getArticleBanner();
this.getArticleCate();
this.status = false;
this.page = 1;
this.articleList = [];
this.getCidArticle();
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.getCidArticle();
},
methods: {
getArticleHot: function() {
let that = this;
getArticleHotList().then(res => {
that.$set(that, 'articleList', res.data.list);
});
},
getArticleBanner: function() {
let that = this;
getArticleBannerList().then(res => {
that.imgUrls = res.data.list;
});
},
getCidArticle: function() {
let that = this;
if (that.active == 0) return;
let limit = that.limit;
let page = that.page;
let articleList = that.articleList;
if (that.status) return;
getArticleList(that.active, {
page: page,
limit: limit
}).then(res => {
let articleListNew = [];
let len = res.data.list.length;
articleListNew = articleList.concat(res.data.list);
that.page++;
that.$set(that, 'articleList', articleListNew);
that.status = limit > len;
that.page = that.page;
});
},
getArticleCate: function() {
let that = this;
getArticleCategoryList().then(res => {
let list = res.data.list;
list.unshift({id:0,name:'热门'});
that.$set(that, 'navList', list);
});
},
tabSelect(active,e) {
this.active = active;
this.scrollLeft = e * 60;
// this.scrollLeft = (active - 1) * 50;
if (this.active == 0) this.getArticleHot();
else {
this.$set(this, 'articleList', []);
this.page = 1;
this.status = false;
this.getCidArticle();
}
}
}
}
</script>
<style lang="scss">
page {
background-color: #fff !important;
}
.newsList .swiper {
width: 100%;
position: relative;
box-sizing: border-box;
padding: 0 30rpx;
}
.newsList .swiper swiper {
width: 100%;
height: 365rpx;
position: relative;
}
.newsList .swiper .slide-image {
width: 100%;
height: 335rpx;
border-radius: 14rpx;
}
// #ifdef MP-WEIXIN
.newsList .swiper .wx-swiper-dot {
width: 12rpx !important;
height: 12rpx !important;
border-radius: 0;
transform: rotate(-45deg);
transform-origin: 0 100%;
}
.newsList .swiper .wx-swiper-dot~.wx-swiper-dot {
margin-left: 5rpx;
}
.newsList .swiper .wx-swiper-dots.wx-swiper-dots-horizontal {
margin-bottom: -15rpx;
}
// #endif
.newsList .swiper .uni-swiper-dot {
width: 12rpx !important;
height: 12rpx !important;
border-radius: 0;
transform: rotate(-45deg);
transform-origin: 0 100%;
}
.newsList .swiper .uni-swiper-dot~.uni-swiper-dot {
margin-left: 5rpx;
}
.newsList .swiper .uni-swiper-dots.uni-swiper-dots-horizontal {
margin-bottom: -15rpx;
}
.newsList .nav {
padding: 0 24rpx;
width: 100%;
white-space: nowrap;
box-sizing: border-box;
margin-top: 43rpx;
}
.newsList .nav .item {
display: inline-block;
font-size: 32rpx;
color: #999;
}
.newsList .nav .item.on {
color: #282828;
}
.newsList .nav .item~.item {
margin-left: 46rpx;
}
.newsList .nav .item .line {
width: 24rpx;
height: 4rpx;
border-radius: 2rpx;
margin: 10rpx auto 0 auto;
}
.newsList .list .item {
margin: 0 24rpx;
border-bottom: 1rpx solid #f0f0f0;
padding: 35rpx 0;
}
.newsList .list .item .pictrue {
width: 250rpx;
height: 156rpx;
}
.newsList .list .item .pictrue image {
width: 100%;
height: 100%;
border-radius: 14rpx;
}
.newsList .list .item .text {
width: 420rpx;
height: 156rpx;
font-size: 24rpx;
color: #999;
}
.newsList .list .item .text .name {
font-size: 30rpx;
color: #282828;
}
.newsList .list .item .picList .pictrue {
width: 335rpx;
height: 210rpx;
margin-top: 30rpx;
}
.newsList .list .item .picList.on .pictrue {
width: 217rpx;
height: 136rpx;
}
.newsList .list .item .picList .pictrue image {
width: 100%;
height: 100%;
border-radius: 6rpx;
}
.newsList .list .item .time {
text-align: right;
font-size: 24rpx;
color: #999;
margin-top: 22rpx;
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,266 @@
<template>
<view>
<view class='payment-status'>
<!--失败时 用icon-iconfontguanbi fail替换icon-duihao2 bg-color-->
<view class='iconfont icons icon-duihao2 bg-color' v-if="order_pay_info.paid || order_pay_info.payType == 'offline'"></view>
<view class='iconfont icons icon-iconfontguanbi' v-else></view>
<!-- 失败时订单支付失败 -->
<view class='status' v-if="order_pay_info.payType != 'offline'">{{order_pay_info.paid ? '订单支付成功':'订单支付失败'}}</view>
<view class='status' v-else>订单创建成功</view>
<view class='wrapper'>
<view class='item acea-row row-between-wrapper'>
<view>订单编号</view>
<view class='itemCom'>{{order_pay_info.orderId}}</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view>下单时间</view>
<view class='itemCom'>{{order_pay_info.createTime?order_pay_info.createTime:'-'}}</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view>支付方式</view>
<view class='itemCom' v-if="order_pay_info.payType=='weixin'">微信支付</view>
<view class='itemCom' v-else-if="order_pay_info.payType=='yue'">余额支付</view>
<view class='itemCom' v-else-if="order_pay_info.payType=='offline'">线下支付</view>
<view class='itemCom' v-else-if="order_pay_info.payType=='alipay'">支付宝支付</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view>支付金额</view>
<view class='itemCom'>{{order_pay_info.payPrice}}</view>
</view>
<!--失败时加上这个 -->
<view class='item acea-row row-between-wrapper' v-if="order_pay_info.paid==0 && order_pay_info.payType != 'offline'">
<view>失败原因</view>
<view class='itemCom'>{{status==2 ? '取消支付':msg}}</view>
</view>
</view>
<!--失败时 重新购买 -->
<view @tap="goOrderDetails">
<button formType="submit" class='returnBnt bg-color' hover-class='none'>查看订单</button>
</view>
<!-- <view @tap="goOrderDetails" v-if="order_pay_info.paid==0 && status==1">
<button class='returnBnt bg-color' hover-class='none'>重新购买</button>
</view>
<view @tap="goOrderDetails" v-if="order_pay_info.paid==0 && status==2">
<button class='returnBnt bg-color' hover-class='none'>重新支付</button>
</view> -->
<button @click="goPink(order_pay_info.pinkId)" class='returnBnt cart-color' formType="submit" hover-class='none' v-if="order_pay_info.pinkId && order_pay_info.paid!=0 && status!=2 && status!=1">邀请好友参团</button>
<button @click="goIndex" class='returnBnt cart-color' formType="submit" hover-class='none' v-else>返回首页</button>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
<script>
import {
getOrderDetail
} from '@/api/order.js';
import {
openOrderSubscribe
} from '@/utils/SubscribeMessage.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
export default {
components: {
// #ifdef MP
authorize
// #endif
},
data() {
return {
orderId: '',
order_pay_info: {
paid: 1,
_status: {}
},
isAuto: false, //没有授权的不会自动授权
isShowAuth: false ,//是否隐藏授权
status:0,
msg:''
};
},
computed: mapGetters(['isLogin']),
watch:{
isLogin:{
handler:function(newV,oldV){
if(newV){
this.getOrderPayInfo();
}
},
deep:true
}
},
onLoad: function(options) {
if (!options.order_id) return this.$util.Tips({
title: '缺少参数无法查看订单支付状态'
}, {
tab: 3,
url: 1
});
this.orderId = options.order_id;
this.status = options.status || 0;
this.msg = options.msg || '';
if (this.isLogin) {
this.getOrderPayInfo();
} else {
toLogin();
}
},
methods: {
onLoadFun: function() {
this.getOrderPayInfo();
},
/**
*
* 支付完成查询支付状态
*
*/
getOrderPayInfo: function() {
let that = this;
uni.showLoading({
title: '正在加载中'
});
getOrderDetail(that.orderId).then(res => {
uni.hideLoading();
that.$set(that, 'order_pay_info', res.data);
uni.setNavigationBarTitle({
title: res.data.paid ? '支付成功' : '支付失败'
});
}).catch(err => {
uni.hideLoading();
});
},
/**
* 去首页关闭当前所有页面
*/
goIndex: function(e) {
uni.switchTab({
url: '/pages/index/index'
});
},
// 去参团页面;
goPink:function(id){
uni.navigateTo({
url: '/pages/activity/goods_combination_status/index?id='+id
});
},
/**
*
* 去订单详情页面
*/
goOrderDetails: function(e) {
let that = this;
// #ifdef MP
uni.showLoading({
title: '正在加载',
})
openOrderSubscribe().then(res => {
uni.hideLoading();
uni.navigateTo({
url: '/pages/order_details/index?order_id=' + that.orderId
});
}).catch(() => {
nui.hideLoading();
});
// #endif
// #ifndef MP
uni.navigateTo({
url: '/pages/order_details/index?order_id=' + that.orderId
})
// #endif
}
}
}
</script>
<style>
.icon-iconfontguanbi{
background-color: #999 !important;
text-shadow: none !important;
}
.payment-status {
background-color: #fff;
margin: 195rpx 30rpx 0 30rpx;
border-radius: 10rpx;
padding: 1rpx 0 28rpx 0;
}
.payment-status .icons {
font-size: 70rpx;
width: 140rpx;
height: 140rpx;
border-radius: 50%;
color: #fff;
text-align: center;
line-height: 140rpx;
text-shadow: 0px 4px 0px #df1e14;
border: 6rpx solid #f5f5f5;
margin: -76rpx auto 0 auto;
background-color: #999;
}
.payment-status .iconfont {
font-size: 70rpx;
width: 140rpx;
height: 140rpx;
border-radius: 50%;
color: #fff;
text-align: center;
line-height: 140rpx;
text-shadow: 0px 4px 0px #df1e14;
border: 6rpx solid #f5f5f5;
margin: -76rpx auto 0 auto;
background-color: #999;
}
.payment-status .iconfont.fail {
text-shadow: 0px 4px 0px #7a7a7a;
}
.payment-status .status {
font-size: 32rpx;
font-weight: bold;
text-align: center;
margin: 25rpx 0 37rpx 0;
}
.payment-status .wrapper {
border: 1rpx solid #eee;
margin: 0 30rpx 47rpx 30rpx;
padding: 35rpx 0;
border-left: 0;
border-right: 0;
}
.payment-status .wrapper .item {
font-size: 28rpx;
color: #282828;
}
.payment-status .wrapper .item~.item {
margin-top: 20rpx;
}
.payment-status .wrapper .item .itemCom {
color: #666;
}
.payment-status .returnBnt {
width: 630rpx;
height: 86rpx;
border-radius: 50rpx;
color: #fff;
font-size: 30rpx;
text-align: center;
line-height: 86rpx;
margin: 0 auto 20rpx auto;
}
</style>

View File

@@ -0,0 +1,8 @@
<template>
</template>
<script>
</script>
<style>
</style>

View File

@@ -0,0 +1,122 @@
<template>
<view class="register absolute">
<view class="shading">
<view class="pictrue acea-row row-center-wrapper">
<image src="../../static/images/logo2.png"></image>
</view>
</view>
<view class="whiteBg">
<view class="title">找回密码</view>
<view class="list">
<view class="item">
<view class="acea-row row-middle">
<image src="/static/images/phone_1.png"></image>
<input type="text" placeholder="输入手机号码" placeholder-class="placeholder" v-model="account" class="input"/>
</view>
</view>
<view class="item">
<view class="align-left acea-row row-middle">
<image src="/static/images/code_2.png"></image>
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" placeholder-class="placeholder"/>
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
{{ text }}
</button>
</view>
</view>
<view class="item">
<view class="acea-row row-middle">
<image src="/static/images/code_1.png"></image>
<input type="password" placeholder="填写您的登录密码" v-model="password" placeholder-class="placeholder" class="input"/>
</view>
</view>
</view>
<view class="logon" @click="registerReset">确认</view>
<navigator url="/pages/users/login/index" class="tip">
<text class="font-color">立即登录</text>
</navigator>
</view>
<view class="bottom"></view>
</view>
</template>
<script>
import sendVerifyCode from "@/mixins/SendVerifyCode";
import { registerVerify, registerReset } from "@/api/user";
export default {
data() {
return {
account: "",
password: "",
captcha: ""
};
},
mixins: [sendVerifyCode],
methods: {
registerReset() {
let that = this;
if (!that.account) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (!that.captcha) return that.$util.Tips({
title: '请填写验证码'
});
if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
title: '请输入正确的验证码'
});
if (!that.password) return that.$util.Tips({
title: '请填写密码'
});
if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/i.test(that.password)) return that.$util.Tips({
title: '您输入的密码过于简单'
});
registerReset({
account: that.account,
captcha: that.captcha,
password: that.password
})
.then(res => {
that.$util.Tips({
title: res,
success: () => {
uni.navigateTo({
url: '/pages/login/index'
});
}
});
})
.catch(res => {
that.$util.Tips({
title: res
});
});
},
async code() {
let that = this;
if (!that.account) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
registerVerify({ phone: that.account })
.then(res => {
that.$util.Tips({
title: res
});
that.sendCode();
})
.catch(res => {
that.$util.Tips({
title: res
});
});
}
}
};
</script>
<style>
</style>

684
pages/user/index.vue Normal file
View File

@@ -0,0 +1,684 @@
<template>
<view class="new-users copy-data">
<!-- 去掉了 :style="{height:pageHeight}" -->
<view class="mid" style="flex: 1; overflow: hidden">
<scroll-view scroll-y="true" style="height: 100%">
<view class="bg"></view>
<view class="head pad30">
<view class="user-card">
<view class="user-info">
<image class="avatar" :src="userInfo.avatar" v-if="userInfo.avatar && uid" @click="goEdit()"></image>
<image v-else class="avatar" src="/static/images/f.png" mode="" @click="goEdit()"></image>
<view class="info">
<view class="name" v-if="!uid" @tap="openAuto">请点击登录</view>
<view class="name" v-if="uid">
{{ userInfo.nickname }}
<view class="vip" v-if="userInfo.levelRatio && userInfo.levelRatio > 0">
<!-- <image :src="userInfo.vipIcon" alt=""> -->
<view style="margin-left: 10rpx" class="vip-txt">{{ userInfo.levelRatioName || '' }}</view>
</view>
</view>
<view v-if="userInfo.account && uid" style="color: #fff">
{{ userInfo.account }}
</view>
<view class="num" v-if="userInfo.phone && uid" @click="goEdit()">
<view class="num-txt">{{ userInfo.phone }}</view>
<!-- <view class="icon">
<image src="/static/images/edit.png" mode=""></image>
</view> -->
</view>
<view class="phone" v-if="!userInfo.phone && isLogin" @tap="bindPhone">绑定手机号</view>
</view>
</view>
<view class="num-wrapper">
<view class="num-item" @click="goMenuPage('/pages/users/user_money/index')">
<text class="num">{{ userInfo.nowMoney && uid ? Number(userInfo.nowMoney).toFixed(2) : 0 }}</text>
<view class="txt">余额</view>
</view>
<!-- <view class="num-item" @click="goMenuPage('/pages/users/user_integral/index')">
<text class="num">{{userInfo.integral && uid ? userInfo.integral: 0}}</text>
<view class="txt">积分</view>
</view>
<view class="num-item" @click="goMenuPage('/pages/users/user_coupon/index')">
<text class="num">{{userInfo.couponCount && uid ? userInfo.couponCount : 0}}</text>
<view class="txt">优惠券</view>
</view> -->
<view class="num-item" @click="goMenuPage('/pages/users/user_goods_collection/index')">
<text class="num">{{ userInfo.collectCount && uid ? userInfo.collectCount : 0 }}</text>
<view class="txt">收藏</view>
</view>
</view>
<!-- <view class="sign" @click="goSignIn">签到</view> -->
</view>
<view class="order-wrapper">
<view class="order-hd flex">
<view class="left">订单中心</view>
<navigator class="right flex" hover-class="none" url="/pages/users/order_list/index" open-type="navigate">
查看全部
<text class="iconfont icon-xiangyou"></text>
</navigator>
</view>
<view class="order-bd">
<block v-for="(item, index) in orderMenu" :key="index">
<navigator class="order-item" hover-class="none" :url="item.url">
<view class="pic">
<image :src="item.img" mode=""></image>
<text class="order-status-num" v-if="item.num > 0">{{ item.num }}</text>
</view>
<view class="txt">{{ item.title }}</view>
</navigator>
</block>
</view>
</view>
</view>
<view class="contenBox">
<!-- 轮播 -->
<view class="slider-wrapper" v-if="imgUrls.length > 0">
<swiper
indicator-dots="true"
:autoplay="autoplay"
:circular="circular"
:interval="interval"
:duration="duration"
indicator-color="rgba(255,255,255,0.6)"
indicator-active-color="#fff"
>
<block v-for="(item, index) in imgUrls" :key="index">
<swiper-item class="borRadius14">
<image :src="item.pic" class="slide-image" @click="navito(item.url)"></image>
</swiper-item>
</block>
</swiper>
</view>
<!-- 会员菜单 -->
<view class="user-menus" style="margin-top: 20rpx">
<view class="menu-title">我的服务</view>
<view class="list-box">
<block v-for="(item, index) in MyMenus" :key="index">
<navigator
class="item"
:url="item.url"
hover-class="none"
v-if="!(item.url == '/pages/service/index' || (item.url == '/pages/users/user_spread_user/index' && !userInfo.isPromoter))"
>
<image :src="item.pic"></image>
<text>{{ item.name }}</text>
</navigator>
</block>
<!-- #ifndef MP -->
<view class="item" @click="kefuClick">
<image :src="servicePic"></image>
<text>联系客服</text>
</view>
<!-- #endif -->
<!-- #ifdef MP -->
<button class="item" open-type="contact" hover-class="none">
<image :src="servicePic"></image>
<text>联系客服</text>
</button>
<!-- #endif -->
</view>
</view>
<view style="height: 30rpx"></view>
<view v-if="userInfo.spreadAccount && uid" style="background-color: #ffffff; padding: 20rpx; border-radius: 10rpx">
<view>邀请人{{ userInfo.spreadAccount }}</view>
</view>
<view style="height: 30rpx"></view>
<view v-if="userInfo.qrCode && uid" style="background-color: #f6faff; padding: 30rpx; border-radius: 10rpx">
<view>
<view style="font-size: 30rpx; color: #999999; text-align: center; margin-bottom: 20rpx">
邀请码{{ userInfo.shareCode }}
<text style="text-decoration: underline; margin-left: 30rpx" @click="copy(userInfo.shareCode)">复制</text>
</view>
<view style="display: flex; align-items: center; justify-content: center">
<u-image :src="userInfo.qrCode" radius="20rpx" width="440rpx" height="440rpx" mode="widthFix"></u-image>
</view>
<view style="height: 10rpx"></view>
<view style="font-size: 30rpx; color: #999999; text-align: center">长按保存或者转发</view>
</view>
</view>
<!-- <image src="/static/images/support.png" alt="" class='support'> -->
<view class="uni-p-b-98"></view>
</view>
</scroll-view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
<script>
let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
import Cache from '@/utils/cache';
import { BACK_URL } from '@/config/cache';
import { getMenuList } from '@/api/user.js';
import { orderData } from '@/api/order.js';
import { toLogin } from '@/libs/login.js';
import { getCity } from '@/api/api.js';
import { mapGetters } from 'vuex';
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
const app = getApp();
export default {
components: {
// #ifdef MP
authorize
// #endif
},
computed: mapGetters(['isLogin', 'chatUrl', 'userInfo', 'uid']),
data() {
return {
orderMenu: [
{
img: '/static/images/order1.png',
title: '待付款',
url: '/pages/users/order_list/index?status=0',
num: 0
},
{
img: '/static/images/order2.png',
title: '待发货',
url: '/pages/users/order_list/index?status=1',
num: 0
},
{
img: '/static/images/order3.png',
title: '待收货',
url: '/pages/users/order_list/index?status=2',
num: 0
},
{
img: '/static/images/order4.png',
title: '待评价',
url: '/pages/users/order_list/index?status=3',
num: 0
},
{
img: '/static/images/order5.png',
title: '售后/退款',
url: '/pages/users/user_return_list/index',
num: 0
}
],
imgUrls: [],
userMenu: [],
autoplay: true,
circular: true,
interval: 3000,
duration: 500,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
orderStatusNum: {},
MyMenus: [],
wechatUrl: [],
servicePic: '/static/images/customer.png',
sysHeight: sysHeight,
// #ifdef MP
pageHeight: '100%',
// #endif
// #ifdef H5
pageHeight: app.globalData.windowHeight
// #endif
};
},
onLoad() {
let that = this;
// #ifdef H5
that.$set(that, 'pageHeight', app.globalData.windowHeight);
// #endif
that.$set(that, 'MyMenus', app.globalData.MyMenus);
if (!this.$Cache.has('cityList')) this.getCityList();
if (that.isLogin == false) {
// #ifdef H5
toLogin();
// #endif
}
},
onShow: function () {
let that = this;
// #ifdef H5
uni.getSystemInfo({
success: function (res) {
that.pageHeight = res.windowHeight + 'px';
}
});
// #endif
if (that.isLogin) {
this.getMyMenus();
// this.setVisit();
this.getOrderData();
this.$store.dispatch('USERINFO');
} else {
toLogin();
}
},
methods: {
copy(e) {
uni.setClipboardData({
data: e,
success: function () {}
});
},
// 记录会员访问
// setVisit(){
// setVisit({
// url:'/pages/user/index'
// }).then(res=>{})
// },
navito(e) {
window.location.href = 'https://' + e;
},
kefuClick() {
location.href = this.chatUrl;
},
getOrderData() {
let that = this;
orderData().then((res) => {
that.orderMenu.forEach((item, index) => {
switch (item.title) {
case '待付款':
item.num = res.data.unPaidCount;
break;
case '待发货':
item.num = res.data.unShippedCount;
break;
case '待收货':
item.num = res.data.receivedCount;
break;
case '待评价':
item.num = res.data.evaluatedCount;
break;
case '售后/退款':
item.num = res.data.refundCount;
break;
}
});
that.$set(that, 'orderMenu', that.orderMenu);
});
},
// 打开授权
openAuto() {
Cache.set(BACK_URL, '');
toLogin();
},
// 授权回调
onLoadFun() {
this.getMyMenus();
// this.setVisit();
this.getOrderData();
},
Setting: function () {
uni.openSetting({
success: function (res) {
console.log(res.authSetting);
}
});
},
// 授权关闭
authColse: function (e) {
this.isShowAuth = e;
},
// 绑定手机
bindPhone() {
uni.navigateTo({
url: '/pages/users/app_login/index'
});
},
/**
*
* 获取个人中心图标
*/
getMyMenus: function () {
let that = this;
if (this.MyMenus.length) return;
getMenuList().then((res) => {
that.$set(that, 'MyMenus', res.data.routine_my_menus);
that.wechatUrl = res.data.routine_my_menus.filter((item) => {
return item.url.indexOf('service') !== -1;
});
res.data.routine_my_menus.map((item) => {
if (item.url.indexOf('service') !== -1) that.servicePic = item.pic;
});
if (res.data.routine_my_banner) {
that.imgUrls = res.data.routine_my_banner;
}
});
},
// 编辑页面
goEdit() {
if (this.isLogin == false) {
toLogin();
} else {
uni.navigateTo({
url: '/pages/users/user_info/index'
});
}
},
// 签到
goSignIn() {
uni.navigateTo({
url: '/pages/users/user_sgin/index'
});
},
// goMenuPage
goMenuPage(url) {
uni.navigateTo({
url
});
},
// 获取地址数据
getCityList: function () {
let that = this;
getCity().then((res) => {
let oneDay = 24 * 3600 * 1000;
this.$Cache.setItem({
name: 'cityList',
value: res.data,
expires: oneDay * 7
}); //设置七天过期时间
});
}
}
};
</script>
<style lang="scss" scoped>
page,
body {
height: 100%;
}
.bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 420rpx;
background-image: url('~@/static/images/user_bg.png');
background-repeat: no-repeat;
background-size: 100% 100%;
}
.contenBox {
padding: 0 30rpx;
}
.support {
width: 219rpx;
height: 74rpx;
margin: 54rpx auto;
display: block;
}
.new-users {
//margin-top: var(--status-bar-height);
display: flex;
flex-direction: column;
height: 100%;
.sys-head {
position: relative;
width: 100%;
background: linear-gradient(90deg, $bg-star1 0%, $bg-end1 100%);
.sys-title {
z-index: 10;
position: relative;
height: 43px;
text-align: center;
line-height: 43px;
font-size: 36rpx;
color: #ffffff;
}
}
.head {
background: linear-gradient(360deg, rgba(255, 121, 49, 0) 0%, rgba(248, 74, 29, 0.82) 39%, #e93323 100%);
// padding: 0 30rpx;
.user-card {
position: relative;
width: 100%;
margin: 0 auto;
padding: 35rpx 0 30rpx 0;
.user-info {
z-index: 20;
position: relative;
display: flex;
.avatar {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
}
.info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
margin-left: 20rpx;
padding: 15rpx 0;
.name {
display: flex;
align-items: center;
color: #fff;
font-size: 31rpx;
.vip {
display: flex;
align-items: center;
padding: 6rpx 20rpx;
background: rgba(0, 0, 0, 0.2);
border-radius: 18px;
font-size: 20rpx;
margin-left: 12rpx;
image {
width: 27rpx;
height: 27rpx;
}
}
}
.num {
display: flex;
align-items: center;
font-size: 26rpx;
color: rgba(255, 255, 255, 0.6);
image {
width: 22rpx;
height: 23rpx;
margin-left: 20rpx;
}
}
}
}
.num-wrapper {
z-index: 30;
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 30rpx;
color: #fff;
.num-item {
width: 33.33%;
text-align: center;
.num {
font-size: 42rpx;
font-weight: bold;
}
.txt {
margin-top: 10rpx;
font-size: 26rpx;
color: rgba(255, 255, 255, 0.6);
}
}
}
.sign {
z-index: 200;
position: absolute;
right: -12rpx;
top: 80rpx;
display: flex;
align-items: center;
justify-content: center;
width: 120rpx;
height: 60rpx;
background: linear-gradient(90deg, rgba(255, 225, 87, 1) 0%, rgba(238, 193, 15, 1) 100%);
border-radius: 29rpx 4rpx 4rpx 29rpx;
color: #282828;
font-size: 28rpx;
font-weight: bold;
}
}
.order-wrapper {
background-color: #fff;
border-radius: 14rpx;
padding: 30rpx 16rpx;
position: relative;
z-index: 11;
.order-hd {
justify-content: space-between;
font-size: 30rpx;
color: #282828;
margin-bottom: 40rpx;
padding: 0 16rpx;
.left {
color: #282828;
font-size: 30rpx;
font-weight: 600;
}
.right {
align-items: center;
color: #666666;
font-size: 26rpx;
.icon-xiangyou {
margin-left: 5rpx;
font-size: 24rpx;
}
}
}
.order-bd {
display: flex;
justify-content: space-between;
padding: 0;
.order-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.pic {
position: relative;
text-align: center;
image {
width: 48rpx;
height: 48rpx;
}
}
.txt {
margin-top: 15rpx;
font-size: 26rpx;
color: #454545;
}
}
}
}
}
.slider-wrapper {
margin: 20rpx 0;
height: 138rpx;
swiper,
swiper-item {
height: 100%;
}
image {
width: 100%;
height: 100%;
}
}
.user-menus {
background-color: #fff;
border-radius: 14rpx;
.menu-title {
padding: 30rpx 30rpx 40rpx;
font-size: 30rpx;
color: #282828;
font-weight: 600;
}
.list-box {
display: flex;
flex-wrap: wrap;
padding: 0;
}
.item {
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
flex-direction: column;
width: 25%;
margin-bottom: 47rpx;
font-size: 26rpx;
color: #333333;
image {
width: 52rpx;
height: 52rpx;
margin-bottom: 18rpx;
}
&:last-child::before {
display: none;
}
}
button {
font-size: 28rpx;
}
}
.phone {
color: #fff;
}
.order-status-num {
min-width: 12rpx;
background-color: #fff;
color: #ee5a52;
border-radius: 15px;
position: absolute;
right: -14rpx;
top: -15rpx;
font-size: 20rpx;
padding: 0 8rpx;
border: 1px solid #ee5a52;
}
}
</style>

378
pages/user/wall.vue Normal file
View File

@@ -0,0 +1,378 @@
<template>
<view>
<view class="my-account">
<view class="wrapper">
<view class="header">
<view class="headerCon">
<view class="account acea-row row-top row-between">
<view class="assets">
<view>总资产()</view>
<view class="money">{{ statistics.nowMoney || 0 }}</view>
</view>
<!-- #ifdef H5 -->
<navigator url="/pages/users/user_payment/index" hover-class="none" class="recharge font-color">充值</navigator>
<!-- #endif -->
<!-- #ifdef MP -->
<view v-if="userInfo.rechargeSwitch" @click="openSubscribe('/pages/users/user_payment/index')" class="recharge font-color">充值</view>
<!-- #endif -->
</view>
<view class="cumulative acea-row row-top">
<!-- #ifdef H5 -->
<view class="item">
<view>累计充值()</view>
<view class="money">{{ statistics.recharge || 0 }}</view>
</view>
<!-- #endif -->
<!-- #ifdef MP -->
<view class="item" v-if="userInfo.rechargeSwitch">
<view>累计充值()</view>
<view class="money">{{ statistics.recharge || 0 }}</view>
</view>
<!-- #endif -->
<view class="item">
<view>累计消费()</view>
<view class="money">{{ statistics.orderStatusSum || 0 }}</view>
</view>
</view>
</view>
</view>
<view class="nav acea-row row-middle">
<navigator class="item" hover-class="none" url="/pages/users/user_bill/index?type=all">
<view class="pictrue">
<image src="../../../static/images/record1.png"></image>
</view>
<view>账单记录</view>
</navigator>
<navigator class="item" hover-class="none" url="/pages/users/user_bill/index?type=expenditure">
<view class="pictrue">
<image src="../../../static/images/record2.png"></image>
</view>
<view>消费记录</view>
</navigator>
<navigator class="item" hover-class="none" url="/pages/users/user_bill/index?type=income" v-if="userInfo.rechargeSwitch">
<view class="pictrue">
<image src="../../../static/images/record3.png"></image>
</view>
<view>充值记录</view>
</navigator>
<navigator class="item" hover-class="none" url="/pages/users/user_integral/index">
<view class="pictrue">
<image src="../../../static/images/record4.png"></image>
</view>
<view>积分中心</view>
</navigator>
</view>
</view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
<script>
import { getProductHot } from '@/api/store.js';
import { openRechargeSubscribe } from '@/utils/SubscribeMessage.js';
import { userActivity, getuserDalance } from '@/api/user.js';
import { toLogin } from '@/libs/login.js';
import { mapGetters } from 'vuex';
import recommend from '@/components/recommend/index';
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import home from '@/components/home';
export default {
components: {
recommend,
// #ifdef MP
authorize,
// #endif
home
},
data() {
return {
hostProduct: [],
isClose: false,
activity: {},
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
hotScroll: false,
statistics: {},
hotPage: 1,
hotLimit: 10
};
},
computed: mapGetters(['isLogin', 'userInfo']),
watch: {
isLogin: {
handler: function (newV, oldV) {
if (newV) {
this.get_host_product();
this.get_activity();
this.userDalance();
}
},
deep: true
}
},
onLoad() {
if (this.isLogin) {
this.get_host_product();
this.get_activity();
this.userDalance();
} else {
toLogin();
}
},
methods: {
onLoadFun: function () {
this.get_host_product();
this.get_activity();
this.userDalance();
},
userDalance() {
getuserDalance().then((res) => {
this.statistics = res.data;
});
},
// 授权关闭
authColse: function (e) {
this.isShowAuth = e;
},
// #ifdef MP
openSubscribe: function (page) {
uni.showLoading({
title: '正在加载'
});
openRechargeSubscribe()
.then((res) => {
uni.hideLoading();
uni.navigateTo({
url: page
});
})
.catch(() => {
uni.hideLoading();
});
},
// #endif
/**
* 获取活动可参与否
*/
get_activity: function () {
// let that = this;
// userActivity().then(res => {
// that.$set(that, "activity", res.data);
// })
},
/**
* 获取我的推荐
*/
get_host_product: function () {
let that = this;
if (that.hotScroll) return;
getProductHot(that.hotPage, that.hotLimit).then((res) => {
that.hotPage++;
that.hotScroll = res.data.list.length < that.hotLimit;
that.hostProduct = that.hostProduct.concat(res.data.list);
});
}
},
onReachBottom() {
this.get_host_product();
}
};
</script>
<style scoped lang="scss">
.my-account .wrapper {
background-color: #fff;
padding: 32rpx 0 15rpx 0;
margin-bottom: 14rpx;
}
.my-account .wrapper .header {
width: 690rpx;
height: 330rpx;
background-image: linear-gradient(to right, #f33b2b 0%, #f36053 100%);
border-radius: 16rpx;
margin: 0 auto;
box-sizing: border-box;
color: rgba(255, 255, 255, 0.6);
font-size: 24rpx;
}
.my-account .wrapper .header .headerCon {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArIAAAFKCAYAAADhULxpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTggKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzMUM4RDlEM0YxNTExRTk4OUJFQ0Q4Qjg0RDBCMzQ1IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzMUM4RDlFM0YxNTExRTk4OUJFQ0Q4Qjg0RDBCMzQ1Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTMxQzhEOUIzRjE1MTFFOTg5QkVDRDhCODREMEIzNDUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTMxQzhEOUMzRjE1MTFFOTg5QkVDRDhCODREMEIzNDUiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6ymvxvAAAIhklEQVR42uzd0W6bQBCG0QWMwfj9nzfNKNBYVSq1iXH443MkXzfdGz6hYbZ7eXlpAACQpncEAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgAgZAEAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAEIWAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgAgZAEAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAEIWAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgAgZAEAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAEIWAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAAIQsAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQBAyAIAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAAIQsAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQBAyAIAIGQBAEDIAgCAkAUA4Ec7OQIAAIJ0r7/h9dcLWQAAjh6tt7/fEwVCFgCAw0frR4QsAADfoV9b9DZc/4uQBQDgkeG6xeuXlw4IWQAA9g7X+nX3/geELAAA99D9Ea67r3kVsgAAfFaNCIztfVzgoYQsAAD/6vat69h2GBcQsgAA3Et/E66HakchCwDAR/G6hethe1HIAgBwG6/1GxL+YCELAPC8ujVczynxKmQBAMTr4WZehSwAAH/rvnPb6XICIQsAwD31a7yO7QEXFAhZAAC+InruVcgCADyfob2/fe2e4T8sZAEAsm1vX5+u64QsAECebfa1ft2zHoKQBQDIUeMDU3t7C/v0hCwAwPGNa8AOjkLIAgAcXY0MbOMDveMQsgAAR2f+VcgCAMQF7LQGLEIWAODwfMAlZAEABKyQBQBgz4CddZiQBQAQsEIWAICdAtYIgZAFAIhRWwhmAStkAQBSdGvAWqMlZAEAYgJ22wPrIgMhCwAQoeJ1FrBCFgAgqaUqYAdHIWQBABLUh1wXLSVkAQBSbHOwk6MQsgAAKczBClkAgCg1/3pp5mCFLABACPtghSwAQJy6jevSjBEIWQCAELYRCFkAgDjbNgJvYYUsAEAEH3MJWQCAKHbCClkAgMgGqrewvaMQsgAACazUErIAAJHd4y2skAUAiFJvYc3CClkAgBg2EghZAIA49QZ2dgxCFgAghdu5hCwAQJxxjVi3cwlZAIAYFbDWaglZAIAYNUqwNB90CVkAgCD1BrY+6DJKIGQBACK4oQshCwDEMUqAkAUA4thKgJAFAOK4ZhYhCwBEqbevi25ByAIASYY1YntHgZAFAFLURoKLY0DIAgBJzMMiZAGAKOZhEbIAQJyag70287AIWQAgrEnqTaz9sAhZACCGj7oQsgBAHB91IWQBgDg1SjA6BoQsAJCi5mDro67BUSBkAYAUNhMgZAGAOMMasTYTIGQBgKjmsF4LIQsARBnXiAUhCwDEsCMWIQsAxKn9sLNjQMgCAElcdICQBQDi1CjB2TEgZAGAJG7r4mEsIwYARCxCFgAQsfAoRgsAgK+6agqELACQpG7pWvQE38VoAQDwWSIWIQsAxDFOgJAFAOJ4E4uQBQAiI9Z2AoQsACBiQcgCAHu6iFiELACQZn79nR0DQhYASDKtPxCyAECMegs7OwaELACQpOZhL44BIQsAJKkdsYtjQMgCAEkGEYuQBQASu6AitnMUCFkAIEXF61UbIGQBABELQhYA2FltJxgcA0IWAEhSe2JdPYuQBQCi1IUHbu1CyAIAUWpXrAsPELIAQNzz365YhCwAEGXbUGBXLEIWAIiyeP4jZAGANLWh4OQYELIAQBIbChCyAECcuuxgdgwIWQAgSX3UtTQfdyFkAYAwPu5CyAIAcXzchZAFAOKMzcddCFkAIPD57vpZhCwAEMXHXQhZACBSzcUOjgEhCwAkOa8/ELIAQNQz3aUHCFkAII65WIQsABCnNhSYi0XIAgBRal+suViELAAQ9xy3LxYhCwDEqYg1F4uQBQCi1PWzJ8eAkAUAktSHXVZtIWQdAQDEMRcLQhYA4riCFoQsAMSpmdjJMYCQBYAktZ3ASAEIWQCIM3tug5AFgDQ1UuD2LhCyABDFSAEIWQCINHleg5AFgDRDs6UAhCwABFocAQhZAEhjpACELABEPp9nxwBCFgDS2FIAQhYA4oztbW8sIGQBIIadsSBkASDSvMYsIGQBIEbtjHUNLQhZAIhjpACELADEqTexg2MAIQsASWom1s5YELIAEGdqPvACIQsAgc/hyTGAkAWAND7wAiELAHFOzQ1eIGQBIJAPvEDIAkAc67ZAyAJAHOu2QMgCQCTrtkDIAkCcCtizYwAhCwBp5uZtLAhZAAh85nobC0IWAOL4wAuELADEqVVbo2MAIQsAaSZHAEIWANJ4GwtCFgAimY2FnfwSYABJ5w5fwq1SbwAAAABJRU5ErkJggg==');
background-repeat: no-repeat;
background-size: 100%;
height: 100%;
width: 100%;
padding: 36rpx 0 29rpx 0;
box-sizing: border-box;
}
.my-account .wrapper .header .headerCon .account {
padding: 0 35rpx;
}
.my-account .wrapper .header .headerCon .account .assets .money {
font-size: 72rpx;
color: #fff;
font-family: 'Guildford Pro';
}
.my-account .wrapper .header .headerCon .account .recharge {
font-size: 28rpx;
width: 150rpx;
height: 54rpx;
border-radius: 27rpx;
background-color: #fff9f8;
text-align: center;
line-height: 54rpx;
}
.my-account .wrapper .header .headerCon .cumulative {
margin-top: 46rpx;
}
.my-account .wrapper .header .headerCon .cumulative .item {
flex: 1;
padding-left: 35rpx;
}
.my-account .wrapper .header .headerCon .cumulative .item .money {
font-size: 48rpx;
font-family: 'Guildford Pro';
color: #fff;
margin-top: 6rpx;
}
.my-account .wrapper .nav {
height: 155rpx;
border-bottom: 1rpx solid #f5f5f5;
}
.my-account .wrapper .nav .item {
flex: 1;
text-align: center;
font-size: 26rpx;
color: #999;
}
.my-account .wrapper .nav .item .pictrue {
width: 44rpx;
height: 44rpx;
margin: 0 auto;
margin-bottom: 20rpx;
}
.my-account .wrapper .nav .item .pictrue image {
width: 100%;
height: 100%;
}
.my-account .wrapper .advert {
padding: 0 30rpx;
margin-top: 30rpx;
}
.my-account .wrapper .advert .item {
background-color: #fff6d1;
width: 332rpx;
height: 118rpx;
border-radius: 10rpx;
padding: 0 27rpx 0 25rpx;
box-sizing: border-box;
font-size: 24rpx;
color: #e44609;
}
.my-account .wrapper .advert .item.on {
background-color: #fff3f3;
color: #e96868;
}
.my-account .wrapper .advert .item .pictrue {
width: 78rpx;
height: 78rpx;
}
.my-account .wrapper .advert .item .pictrue image {
width: 100%;
height: 100%;
}
.my-account .wrapper .advert .item .text .name {
font-size: 30rpx;
font-weight: bold;
color: #f33c2b;
margin-bottom: 7rpx;
}
.my-account .wrapper .advert .item.on .text .name {
color: #f64051;
}
.my-account .wrapper .list {
padding: 0 30rpx;
}
.my-account .wrapper .list .item {
margin-top: 44rpx;
}
.my-account .wrapper .list .item .picTxt .iconfont {
width: 82rpx;
height: 82rpx;
border-radius: 50%;
background-image: linear-gradient(to right, #ff9389 0%, #f9776b 100%);
text-align: center;
line-height: 82rpx;
color: #fff;
font-size: 40rpx;
}
.my-account .wrapper .list .item .picTxt .iconfont.yellow {
background-image: linear-gradient(to right, #ffccaa 0%, #fea060 100%);
}
.my-account .wrapper .list .item .picTxt .iconfont.green {
background-image: linear-gradient(to right, #a1d67c 0%, #9dd074 100%);
}
.my-account .wrapper .list .item .picTxt {
width: 428rpx;
font-size: 30rpx;
color: #282828;
}
.my-account .wrapper .list .item .picTxt .text {
width: 317rpx;
}
.my-account .wrapper .list .item .picTxt .text .infor {
font-size: 24rpx;
color: #999;
margin-top: 5rpx;
}
.my-account .wrapper .list .item .bnt {
font-size: 26rpx;
color: #282828;
width: 156rpx;
height: 52rpx;
border: 1rpx solid #ddd;
border-radius: 26rpx;
text-align: center;
line-height: 52rpx;
}
.my-account .wrapper .list .item .bnt.end {
font-size: 26rpx;
color: #aaa;
background-color: #f2f2f2;
border-color: #f2f2f2;
}
</style>

View File

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

@@ -0,0 +1,120 @@
<template>
<view class="addBankCard p30">
<view style="height: 30rpx"></view>
<view>
<view class="addBankCard_input_tit">请输入{{ enterprise.type == 1 ? '姓名' : '企业名称' }}</view>
<view class="addBankCard_input">
<u-input :border="false" placeholder="请输入" v-model="enterprise.name"></u-input>
</view>
<!-- <view v-if="enterprise.type == 2">
<view class="addBankCard_input_tit">请输入纳税人识别号</view>
<view class="addBankCard_input">
<u-input :border="false" placeholder="请输入" v-model="enterprise.taxNo"></u-input>
</view>
</view> -->
<view v-if="enterprise.type == 1">
<view class="addBankCard_input_tit">请输入手机号</view>
<view class="addBankCard_input">
<u-input :border="false" placeholder="请输入" v-model="enterprise.phone"></u-input>
</view>
</view>
<view v-if="enterprise.type == 1">
<view class="addBankCard_input_tit">请输入身份证号</view>
<view class="addBankCard_input">
<u-input :border="false" placeholder="请输入" v-model="enterprise.idCard"></u-input>
</view>
</view>
<!--
<view class="addBankCard_input_tit">请输入开户行名称</view>
<view class="addBankCard_input">
<u-input :border="false" placeholder="请输入" v-model="enterprise.bankName"></u-input>
</view> -->
<view class="addBankCard_input_tit" v-if="enterprise.type == 2">请输入开户行</view>
<view class="addBankCard_input" v-if="enterprise.type == 2">
<u-input :border="false" placeholder="请输入" v-model="enterprise.subbranchName"></u-input>
</view>
<view class="addBankCard_input_tit">请输入银行卡卡号</view>
<view class="addBankCard_input">
<u-input :border="false" placeholder="请输入" v-model="enterprise.bankCard"></u-input>
</view>
</view>
<view style="margin: 30rpx 0">
<view style="font-size: 28rpx; color: coral">请仔细核对信息填写错误会导致提现失败</view>
</view>
<view style="display: flex; justify-content: center">
<view class="addBankCard_btn" @click="addBank">确定</view>
</view>
</view>
</template>
<script>
// registerVerify
import { addUsersAccountInfo } from '@/api/api';
export default {
data() {
return {
value: '',
getInfo: {},
enterprise: {
type: 1
},
bank: null
};
},
onLoad(options) {
this.enterprise.type = options.type;
},
methods: {
async addBank() {
if (this.enterprise.type == 2) {
this.enterprise.taxNo = '';
this.enterprise.bankName = '';
} else {
this.enterprise.bankName = '';
}
let _res = await addUsersAccountInfo(this.enterprise);
uni.showToast({ title: '添加成功', icon: 'none' });
setTimeout(() => {
uni.navigateBack();
}, 1500);
}
}
};
</script>
<style scoped lang="scss">
.addBankCard {
// @include flex();
&_input {
width: 690rpx;
height: 70rpx;
background: #ffffff;
border-radius: 8rpx 8rpx 8rpx 8rpx;
@include flex;
margin-bottom: 30rpx;
padding: 0 30rpx;
&_tit {
width: 100%;
font-weight: bold;
font-size: 26rpx;
color: #232323;
margin-bottom: 20rpx;
}
}
&_btn {
width: 488rpx;
height: 86rpx;
background: #e93323;
border-radius: 44rpx 44rpx 44rpx 44rpx;
@include flex($space: center);
font-weight: bold;
font-size: 28rpx;
color: #ffffff;
}
}
</style>

View File

@@ -0,0 +1,103 @@
<template>
<view class="bankCard">
<z-paging ref="paging" v-model="dataList" @query="queryList">
<view class="p30">
<view class="bankCard_add" @click="addBank">
<u-icon name="plus" color="#333" size="28"></u-icon>
<view style="font-size: 26rpx; color: #333; margin-top: 15rpx">添加银行卡</view>
</view>
</view>
<view style="height: 30rpx"></view>
<view v-for="(item, index) in dataList" :key="index" @click="bankSele(item)">
<view class="p30">
<view style="background-color: #ffffff; border-radius: 12rpx; padding: 20rpx; margin-bottom: 20rpx">
<view style="font-size: 28rpx; display: flex; align-items: center">
<view>
<u-tag :text="item.type == 1 ? '个人' : '企业'" size="mini" :type="item.type == 1 ? 'success' : 'error'" plain plainFill></u-tag>
</view>
<view style="width: 30rpx"></view>
<view style="font-size: 26rpx">{{ item.name }}</view>
<view style="width: 30rpx"></view>
<view style="font-size: 26rpx">{{ item.phone || '' }}</view>
</view>
<view style="height: 20rpx"></view>
<view style="color: #232323">
<view style="font-size: 28rpx" v-if="item.type == 2">开户行{{ item.subbranchName }}</view>
<view style="height: 10rpx"></view>
<view style="font-size: 28rpx">银行卡号{{ item.bankCard }}</view>
<view style="height: 10rpx"></view>
</view>
</view>
</view>
</view>
</z-paging>
</view>
</template>
<script>
import { getUsersAccountInfo } from '@/api/api';
export default {
data() {
return {
dataList: []
};
},
onShow() {},
onLoad(options) {
if (options.type) {
this.type = options.type;
}
},
methods: {
addBank() {
uni.showActionSheet({
itemList: ['个人', '企业'],
success: (res) => {
if (res.tapIndex + 1 == 0) {
console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
} else {
uni.navigateTo({
url: `/pages/users/bank/addBankCard?type=${res.tapIndex + 1}`
});
}
},
fail: function (res) {
console.log(res.errMsg);
}
});
},
bankSele(e) {
if (this.type) {
uni.$emit('bank', e);
uni.navigateBack();
}
},
queryList(pageNo, pageSize) {
const params = {
current: pageNo,
pageSize: pageSize
};
getUsersAccountInfo(params)
.then(({ data }) => {
this.$refs.paging.complete(data);
})
.catch((res) => {
this.$refs.paging.complete(false);
});
}
}
};
</script>
<style scoped lang="scss">
.bankCard {
&_add {
width: 690rpx;
height: 174rpx;
background: #eeeeee;
border-radius: 16rpx 16rpx 16rpx 16rpx;
@include flex($direction: column, $space: center);
margin-top: 30rpx;
}
}
</style>

File diff suppressed because one or more lines are too long

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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>

731
pages/users/login/index.vue Normal file
View File

@@ -0,0 +1,731 @@
<template>
<div class="login-wrapper">
<div
class="shading"
:style="{
marginTop: current == 1 ? '100rpx' : '200rpx'
}"
>
<view>星梦供应链</view>
</div>
<div class="whiteBg" v-if="formItem === 1">
<div class="list" v-if="current === 0">
<form @submit.prevent="submit">
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/phone_1.png" style="width: 24rpx; height: 34rpx"></image>
<input type="text" class="texts" placeholder="请输入用户名" v-model="formData.account" required />
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx"></image>
<input type="password" class="texts" placeholder="请输入密码" v-model="formData.password" required />
</div>
</div>
</form>
<view style="display: flex; align-items: center; justify-content: space-between; color: #e93323; opacity: 0.7">
<view @click="currentChange(3)">找回账号</view>
<view @click="currentChange(2)">忘记密码立即找回</view>
</view>
</div>
<div class="list" v-if="current === 1">
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/phone_1.png" style="width: 24rpx; height: 34rpx"></image>
<input type="text" class="texts" placeholder="请输入用户名" v-model="formData.account" />
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png" style="width: 24rpx; height: 34rpx"></image>
<input type="password" class="texts" placeholder="请输入密码" v-model="formData.passwd" />
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png" style="width: 24rpx; height: 34rpx"></image>
<input type="password" class="texts" placeholder="请确认密码" v-model="passwdss" />
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/phone_1.png" style="width: 24rpx; height: 34rpx"></image>
<input type="text" class="texts" placeholder="请输入邀请码" v-model="formData.shareCode" />
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/phone_1.png" style="width: 24rpx; height: 34rpx"></image>
<input type="text" class="texts" placeholder="请输入手机号" v-model="formData.phone" />
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx"></image>
<input type="text" placeholder="填写验证码" class="texts" v-model="formData.captcha" />
<button class="code" :class="disabled === true ? 'on' : ''" @click="code">
{{ text }}
</button>
</div>
</div>
</div>
<!-- 忘记密码 -->
<div class="list" v-if="current === 2">
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/phone_1.png" style="width: 24rpx; height: 34rpx"></image>
<input type="text" class="texts" placeholder="请输入用户名" v-model="formData.account" required />
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx"></image>
<input type="password" class="texts" placeholder="请输入新密码" v-model="formData.passwd" required />
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/phone_1.png" style="width: 24rpx; height: 34rpx"></image>
<input type="text" class="texts" placeholder="请输入手机号" v-model="formData.phone" />
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx"></image>
<input type="text" placeholder="填写验证码" class="texts" v-model="formData.captcha" />
<button class="code" :class="disabled === true ? 'on' : ''" @click="code">
{{ text }}
</button>
</div>
</div>
</div>
<!-- 找回账号 -->
<div class="list" v-if="current === 3">
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/phone_1.png" style="width: 24rpx; height: 34rpx"></image>
<input type="text" class="texts" placeholder="请输入手机号" v-model="formData.phone" />
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx"></image>
<input type="text" placeholder="填写验证码" class="texts" v-model="formData.captcha" />
<button class="code" :class="disabled === true ? 'on' : ''" @click="code">
{{ text }}
</button>
</div>
</div>
</div>
<div class="logon" @click="submit" v-if="current === 0">登录</div>
<div class="logon" style="opacity: 0.7; margin-top: 50rpx" @click="currentChange(1)" v-if="current === 0">立即注册</div>
<div class="logon" @click="loginMobile" v-if="current === 1">注册</div>
<div class="logon" style="opacity: 0.7; margin-top: 50rpx" @click="currentChange(0)" v-if="current === 1">立即登录</div>
<div class="logon" @click="wangPass" v-if="current === 2">确认</div>
<div class="logon" @click="zhaoUser" v-if="current === 3">立即找回</div>
<div class="logon" style="opacity: 0.7; margin-top: 50rpx" @click="currentChange(0)" v-if="current === 2 || current === 3">前往登录</div>
</div>
<div class="bottom"></div>
</div>
</template>
<script>
import dayjs from '@/plugin/dayjs/dayjs.min.js';
import sendVerifyCode from '@/mixins/SendVerifyCode';
import {
loginH5,
registerVerify,
register,
// getCodeApi,
getUserInfo,
saveOpenIdByWxCode,
forgotPassword,
forgotUserName
} from '@/api/user';
import attrs, { required, alpha_num, chs_phone } from '@/utils/validate';
import { validatorDefaultCatch } from '@/utils/dialog';
import { getLogo, appAuth, appleLogin } from '@/api/public';
import { VUE_APP_API_URL } from '@/utils';
import { registerMobile } from '@/api/api';
const BACK_URL = 'login_back_url';
export default {
name: 'Login',
mixins: [sendVerifyCode],
data: function () {
return {
navList: ['快速登录', '账号登录'],
current: 0,
account: '',
password: '',
captcha: '',
formItem: 1,
type: 'login',
logoUrl: '',
keyCode: '',
codeUrl: '',
codeVal: '',
isShowCode: false,
platform: '',
appLoginStatus: false, // 微信登录强制绑定手机号码状态
appUserInfo: null, // 微信登录保存的用户信息
appleLoginStatus: false, // 苹果登录强制绑定手机号码状态
appleUserInfo: null,
appleShow: false, // 苹果登录版本必须要求ios13以上的
passwdss: '',
formData: {
account: '',
captcha: '',
passwd: '',
phone: '',
shareCode: ''
},
shareCode: ''
};
},
watch: {
formItem: function (nval, oVal) {
if (nval == 1) {
this.type = 'login';
} else {
this.type = 'register';
}
}
},
mounted: function () {
this.getCode();
this.getLogoImage();
},
onLoad() {
const invite_code = uni.getStorageSync('user_shareCode');
if (invite_code) {
this.formData.shareCode = invite_code;
this.shareCode = invite_code;
}
let self = this;
uni.getSystemInfo({
success: function (res) {
if (res.platform.toLowerCase() == 'ios' && res.system.split(' ')[1] >= 13) {
self.appleShow = true;
}
}
});
},
methods: {
currentChange(e) {
this.current = e;
switch (e) {
case 0:
this.formData = {
account: '',
password: ''
};
break;
case 1:
this.formData = {
account: '',
captcha: '',
passwd: '',
phone: '',
shareCode: this.shareCode
};
break;
case 2:
this.formData = {
account: '',
passwd: '',
phone: '',
captcha: ''
};
break;
case 3:
this.formData = {
phone: '',
captcha: ''
};
break;
}
},
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 + '/sms_captcha?' + 'key=' + this.keyCode + Date.parse(new Date());
},
getCode() {
let that = this;
},
async getLogoImage() {
let that = this;
getLogo().then((res) => {
that.logoUrl = res.data.logoUrl ? res.data.logoUrl : '/static/images/live-logo.gif';
});
},
wangPass() {
let that = this;
if (!that.formData.account)
return that.$util.Tips({
title: '请填写用户名'
});
if (!that.formData.passwd)
return that.$util.Tips({
title: '请填写密码'
});
if (!that.formData.phone)
return that.$util.Tips({
title: '请填写手机号'
});
if (!that.formData.captcha)
return that.$util.Tips({
title: '请填写验证码'
});
forgotPassword(that.formData).then((res) => {
uni.showModal({
title: '提示',
content: '密码已修改',
showCancel: false,
confirmText: '确认',
success: () => {
this.current = 0;
}
});
});
},
zhaoUser() {
let that = this;
if (!that.formData.phone)
return that.$util.Tips({
title: '请填写手机号'
});
if (!that.formData.captcha)
return that.$util.Tips({
title: '请填写验证码'
});
forgotUserName(that.formData).then((res) => {
uni.showModal({
title: '已找回的用户名',
content: res.data.userNames.join(','),
showCancel: false,
confirmText: '确认',
success: () => {
uni.setClipboardData({
data: res.data.userNames.join(','), //要被复制的内容
success: () => {
//复制成功的回调函数
uni.showToast({
//提示
title: '已复制用户名'
});
this.current = 0;
}
});
}
});
});
},
async loginMobile() {
let that = this;
if (!that.formData.account)
return that.$util.Tips({
title: '请填写用户名'
});
if (!that.formData.passwd)
return that.$util.Tips({
title: '请填写密码'
});
if (that.formData.passwd != that.passwdss)
return that.$util.Tips({
title: '两次密码输入不一致'
});
if (!that.formData.shareCode)
return that.$util.Tips({
title: '请填写邀请码'
});
if (!that.formData.phone)
return that.$util.Tips({
title: '请填写手机号'
});
if (!that.formData.captcha)
return that.$util.Tips({
title: '请填写验证码'
});
registerMobile(that.formData)
.then((res) => {
that.$util.Tips({
title: '注册成功'
});
that.current = 0;
that.formData.passwd = '';
that.formData.shareCode = '';
that.formData.phone = '';
that.formData.captcha = '';
that.passwdss = '';
})
.catch((res) => {
that.$util.Tips({
title: res
});
});
},
async register() {
let that = this;
if (!that.account)
return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account))
return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (!that.captcha)
return that.$util.Tips({
title: '请填写验证码'
});
if (!/^[\w\d]+$/i.test(that.captcha))
return that.$util.Tips({
title: '请输入正确的验证码'
});
if (!that.password)
return that.$util.Tips({
title: '请填写密码'
});
if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/i.test(that.password))
return that.$util.Tips({
title: '您输入的密码过于简单'
});
register({
account: that.account,
captcha: that.captcha,
password: that.password,
spread: that.$Cache.get('spread')
})
.then((res) => {
that.$util.Tips({
title: res
});
that.formItem = 1;
})
.catch((res) => {
that.$util.Tips({
title: res
});
});
},
async code() {
let that = this;
if (!that.formData.phone)
return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.formData.phone))
return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (that.formItem == 2) that.type = 'register';
await registerVerify(that.formData.phone)
.then((res) => {
that.$util.Tips({ title: res.message });
that.sendCode();
})
.catch((err) => {
return that.$util.Tips({
title: err
});
});
},
navTap: function (index) {
this.current = index;
},
async submit() {
// let data = {
// code: '000000',
// msg: '操作成功',
// resp_time: '20241129145034',
// resp_data: {
// merchant_no: '8225850553300UN',
// channel_id: '95',
// out_order_no: '202411291106',
// order_create_time: '20241129145034',
// order_efficient_time: '20241201145034',
// pay_order_no: '24112911012001101011279773541',
// total_amount: '1',
// counter_url:
// 'https://pay.lakala.com/r/0000?pageStyle%3DV2%26token%3DCCSSDVvTh2uC7cMMVJLYg8gRw4thq1rVOYD88VZKXYGDvWebqiJgVEsQHIEwDgwQBLDF1zGzjQan-8nuhQ%3D%3D%26amount%3D1%26payOrderNo%3D24112911012001101011279773541%26mndf%3D1'
// }
// };
// wx.openEmbeddedMiniProgram({
// appId: 'wx889424d565967811',
// path: `payment-cashier/pages/checkout/index?source=WECHATMINI&counterUrl=${encodeURIComponent(data.resp_data.counter_url)}`,
// envVersion: 'release',
// // release: 正式版 trial: 体验版
// success(res) {
// // 打开成功
// }
// });
// return;
let that = this;
if (!that.formData.account)
return that.$util.Tips({
title: '请填写账号'
});
if (!that.formData.password)
return that.$util.Tips({
title: '请填写密码'
});
loginH5({
account: that.formData.account,
password: that.formData.password,
spread: that.$Cache.get('spread')
})
.then(({ data }) => {
this.$store.commit('LOGIN', {
token: data.token
});
// that.getUserInfo(data);
uni.login({
success({ code }) {
saveOpenIdByWxCode({ loginCode: code }).then((res) => {
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: '/pages/index/index'
});
return;
console.log(69999);
console.log(backUrl);
uni.reLaunch({
url: backUrl
});
});
}
}
};
</script>
<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 {
// flex: 1;
// margin-left: 20rpx;
// }
}
.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 */
view {
font-size: 38rpx;
font-weight: bold;
}
image {
width: 180rpx;
height: 180rpx;
border-radius: 10rpx;
}
}
.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;
margin-left: 20rpx;
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;
// }
.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>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,550 @@
<template>
<view>
<view class='my-order'>
<view class='header bg-color'>
<view class='picTxt acea-row row-between-wrapper'>
<view class='text'>
<view class='name'>订单信息</view>
<view>消费订单{{orderData.orderCount || 0}} 总消费{{Number(orderData.sumPrice).toFixed(2) || 0}}</view>
</view>
<view class='pictrue'>
<image src='../../../static/images/orderTime.png'></image>
</view>
</view>
</view>
<view class='nav acea-row row-around'>
<view class='item' :class='orderStatus==0 ? "on": ""' @click="statusClick(0)">
<view>待付款</view>
<view class='num'>{{orderData.unPaidCount || 0}}</view>
</view>
<view class='item' :class='orderStatus==1 ? "on": ""' @click="statusClick(1)">
<view>待发货</view>
<view class='num'>{{orderData.unShippedCount || 0}}</view>
</view>
<view class='item' :class='orderStatus==2 ? "on": ""' @click="statusClick(2)">
<view>待收货</view>
<view class='num '>{{orderData.receivedCount || 0}}</view>
</view>
<view class='item' :class='orderStatus==3 ? "on": ""' @click="statusClick(3)">
<view>待评价</view>
<view class='num'>{{orderData.evaluatedCount || 0}}</view>
</view>
<view class='item' :class='orderStatus==4 ? "on": ""' @click="statusClick(4)">
<view>已完成</view>
<view class='num'>{{orderData.completeCount || 0}}</view>
</view>
</view>
<view class='list'>
<view class='item' v-for="(item,index) in orderList" :key="index">
<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.activityType !== '普通' && item.activityType !== '核销'">{{item.activityType}}</text>
<!-- <text class="sign cart-color acea-row row-center-wrapper" v-if="item.bargainId != 0">砍价</text>
<text class="sign cart-color acea-row row-center-wrapper" v-else-if="item.storeOrder.combinationId != 0">拼团</text>
<text class="sign cart-color acea-row row-center-wrapper" v-else-if="item.storeOrder.seckillId != 0">秒杀</text> -->
<view>{{item.createTime}}</view>
</view>
<view class='font-color'>{{item.orderStatus}}</view>
<!-- <view v-if="item.status?item.status.type == 0:0" class='font-color'>待付款</view>
<view v-else-if="item.status?item.status.type == 1:0 && item.storeOrder.shippingType==1" class='font-color'>待发货</view>
<view v-else-if="item.status?item.status.type == 2:0 && item.storeOrder.shippingType==1" class='font-color'>待收货</view>
<view v-else-if="item.status?item.status.type == 3:0 && item.storeOrder.shippingType==1" class='font-color'>待评价</view>
<view v-else-if="item.status?item.status.type == 4:0 && item.storeOrder.shippingType==1" class='font-color'>已完成</view>
<view v-else-if="item.storeOrder.shippingType==2" class='font-color'>待核销</view> -->
</view>
<view class='item-info acea-row row-between row-top' v-for="(items,index) in item.orderInfoList" :key="index">
<view class='pictrue'>
<image :src='items.image'></image>
</view>
<view class='text acea-row row-between'>
<view class='name line2'>{{items.storeName}}</view>
<view class='money'>
<view>{{items.price}}</view>
<view>x{{items.cartNum}}</view>
</view>
</view>
</view>
<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.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">
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view>
<view v-if="orderList.length == 0">
<emptyPage title="暂无订单~"></emptyPage>
</view>
</view>
<view class='noCart' v-if="orderList.length == 0 && page > 1">
<view class='pictrue'>
<image src='/images/noOrder.png'></image>
</view>
</view>
<!-- #ifdef MP -->
<!-- <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>
</view>
</template>
<script>
import {
getOrderList,
orderData,
orderCancel,
orderDel
} from '@/api/order.js';
import {
openOrderSubscribe
} from '@/utils/SubscribeMessage.js';
import home from '@/components/home';
import payment from '@/components/payment';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import emptyPage from '@/components/emptyPage.vue'
export default {
components: {
payment,
home,
emptyPage,
// #ifdef MP
authorize
// #endif
},
data() {
return {
loading: false, //是否加载中
loadend: false, //是否加载完毕
loadTitle: '加载更多', //提示语
orderList: [], //订单数组
orderData: {}, //订单详细统计
orderStatus: 0, //订单状态
page: 1,
limit: 20,
payMode: [{
name: "微信支付",
icon: "icon-weixinzhifu",
value: 'weixin',
title: '微信快捷支付'
},
{
name: "余额支付",
icon: "icon-yuezhifu",
value: 'yue',
title: '可用余额:',
number: 0
}
],
pay_close: false,
pay_order_id: '',
totalPrice: '0',
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
};
},
computed: mapGetters(['isLogin', 'userInfo']),
onShow() {
if (this.isLogin) {
this.loadend = false;
this.page = 1;
this.$set(this, 'orderList', []);
this.getOrderData();
this.getOrderList();
this.payMode[1].number = this.userInfo.nowMoney;
this.$set(this, 'payMode', this.payMode);
} else {
toLogin();
}
},
methods: {
onLoadFun() {
this.getOrderData();
this.getOrderList();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
/**
* 事件回调
*
*/
onChangeFun: function(e) {
let opt = e;
let action = opt.action || null;
let value = opt.value != undefined ? opt.value : null;
(action && this[action]) && this[action](value);
},
/**
* 关闭支付组件
*
*/
payClose: function() {
this.pay_close = false;
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
if (options.status) this.orderStatus = options.status;
},
/**
* 获取订单统计数据
*
*/
getOrderData: function() {
let that = this;
orderData().then(res => {
that.$set(that, 'orderData', res.data);
})
},
/**
* 取消订单
*
*/
cancelOrder: function(index, order_id) {
let that = this;
if (!order_id) return that.$util.Tips({
title: '缺少订单号无法取消订单'
});
uni.showLoading({
title: '正在删除中'
});
orderCancel(order_id).then(res => {
uni.hideLoading();
return that.$util.Tips({
title: '删除成功',
icon: 'success'
}, function() {
that.orderList.splice(index, 1);
that.$set(that, 'orderList', that.orderList);
that.$set(that.orderData, 'unpaid_count', that.orderData.unpaid_count - 1);
that.getOrderData();
});
}).catch(err => {
return that.$util.Tips({
title: err
});
});
},
/**
* 打开支付组件
*
*/
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);
},
/**
* 支付成功回调
*
*/
pay_complete: function() {
this.loadend = false;
this.page = 1;
this.$set(this, 'orderList', []);
this.$set(this, 'pay_close', false);
this.getOrderData();
this.getOrderList();
},
/**
* 支付失败回调
*
*/
pay_fail: function() {
this.pay_close = false;
},
/**
* 去订单详情
*/
goOrderDetails: function(order_id) {
if (!order_id) return that.$util.Tips({
title: '缺少订单号无法查看订单详情'
});
// #ifdef MP
uni.showLoading({
title: '正在加载',
})
openOrderSubscribe().then(() => {
uni.hideLoading();
uni.navigateTo({
url: '/pages/order_details/index?order_id=' + order_id
})
}).catch(() => {
uni.hideLoading();
})
// #endif
// #ifndef MP
uni.navigateTo({
url: '/pages/order_details/index?order_id=' + order_id
})
// #endif
},
/**
* 切换类型
*/
statusClick: function(status) {
if (status == this.orderStatus) return;
this.orderStatus = status;
this.loadend = false;
this.page = 1;
this.$set(this, 'orderList', []);
this.getOrderList();
},
/**
* 获取订单列表
*/
getOrderList: function() {
let that = this;
if (that.loadend) return;
if (that.loading) return;
that.loading = true;
that.loadTitle = "加载更多";
getOrderList({
type: that.orderStatus,
page: that.page,
limit: that.limit,
}).then(res => {
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);
that.loadend = loadend;
that.loading = false;
that.loadTitle = loadend ? "我也是有底线的" : '加载更多';
that.page = that.page + 1;
}).catch(err => {
that.loading = false;
that.loadTitle = "加载更多";
})
},
/**
* 删除订单
*/
delOrder: function(order_id, index) {
let that = this;
orderDel(order_id).then(res => {
that.orderList.splice(index, 1);
that.$set(that, 'orderList', that.orderList);
that.$set(that.orderData, 'unpaid_count', that.orderData.unpaid_count - 1);
that.getOrderData();
return that.$util.Tips({
title: '删除成功',
icon: 'success'
});
}).catch(err => {
return that.$util.Tips({
title: err
});
})
},
},
onReachBottom: function() {
this.getOrderList();
}
}
</script>
<style scoped lang="scss">
.my-order .header {
height: 250rpx;
padding: 0 30rpx;
}
.my-order .header .picTxt {
height: 190rpx;
}
.my-order .header .picTxt .text {
color: rgba(255, 255, 255, 0.8);
font-size: 26rpx;
font-family: 'Guildford Pro';
}
.my-order .header .picTxt .text .name {
font-size: 34rpx;
font-weight: bold;
color: #fff;
margin-bottom: 20rpx;
}
.my-order .header .picTxt .pictrue {
width: 122rpx;
height: 109rpx;
}
.my-order .header .picTxt .pictrue image {
width: 100%;
height: 100%;
}
.my-order .nav {
background-color: #fff;
width: 690rpx;
height: 140rpx;
border-radius: 14rpx;
margin: -60rpx auto 0 auto;
}
.my-order .nav .item {
text-align: center;
font-size: 26rpx;
color: #282828;
padding: 26rpx 0;
}
.my-order .nav .item.on {
// font-weight: bold;
// border-bottom: 5rpx solid #e93323;
/* #ifdef H5 || MP */
font-weight: bold;
/* #endif */
border-bottom: 5rpx solid $theme-color;
}
.my-order .nav .item .num {
margin-top: 18rpx;
}
.my-order .list {
width: 690rpx;
margin: 14rpx auto 0 auto;
}
.my-order .list .item {
background-color: #fff;
border-radius: 14rpx;
margin-bottom: 14rpx;
}
.my-order .list .item .title {
height: 84rpx;
padding: 0 24rpx;
border-bottom: 1rpx solid #eee;
font-size: 28rpx;
color: #282828;
}
.my-order .list .item .title .sign {
font-size: 24rpx;
padding: 0 13rpx;
height: 36rpx;
margin-right: 15rpx;
border-radius: 18rpx;
}
.my-order .list .item .item-info {
padding: 0 24rpx;
margin-top: 22rpx;
}
.my-order .list .item .item-info .pictrue {
width: 120rpx;
height: 120rpx;
}
.my-order .list .item .item-info .pictrue image {
width: 100%;
height: 100%;
border-radius: 14rpx;
}
.my-order .list .item .item-info .text {
width: 500rpx;
font-size: 28rpx;
color: #999;
}
.my-order .list .item .item-info .text .name {
width: 350rpx;
color: #282828;
}
.my-order .list .item .item-info .text .money {
text-align: right;
}
.my-order .list .item .totalPrice {
font-size: 26rpx;
color: #282828;
text-align: right;
margin: 27rpx 0 0 30rpx;
padding: 0 30rpx 30rpx 0;
border-bottom: 1rpx solid #eee;
}
.my-order .list .item .totalPrice .money {
font-size: 28rpx;
font-weight: bold;
}
.my-order .list .item .bottom {
height: 107rpx;
padding: 0 30rpx;
}
.my-order .list .item .bottom .bnt {
width: 176rpx;
height: 60rpx;
text-align: center;
line-height: 60rpx;
color: #fff;
border-radius: 50rpx;
font-size: 27rpx;
}
.my-order .list .item .bottom .bnt.cancelBnt {
border: 1rpx solid #ddd;
color: #aaa;
}
.my-order .list .item .bottom .bnt~.bnt {
margin-left: 17rpx;
}
.noCart {
margin-top: 171rpx;
padding-top: 0.1rpx;
}
.noCart .pictrue {
width: 414rpx;
height: 336rpx;
margin: 78rpx auto 56rpx auto;
}
.noCart .pictrue image {
width: 100%;
height: 100%;
}
</style>

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

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

View File

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

File diff suppressed because one or more lines are too long

View File

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

BIN
pages/users/static/home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
pages/users/static/left.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
pages/users/static/vip.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,589 @@
<template>
<view>
<!-- #ifdef APP-->
<view class='status'></view>
<!-- #endif -->
<form @submit="formSubmit" report-submit='true'>
<view class='addAddress pad30'>
<view class='list borRadius14'>
<view class='item acea-row row-between-wrapper' style="border: none;">
<view class='name'>姓名</view>
<input type='text' placeholder='请输入姓名' placeholder-style="color:#ccc;" name='realName' :value="userAddress.realName"
placeholder-class='placeholder'></input>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='name'>联系电话</view>
<input type='number' placeholder='请输入联系电话' placeholder-style="color:#ccc;" name="phone" :value='userAddress.phone'
placeholder-class='placeholder' maxlength="11"></input>
</view>
<view class='item acea-row row-between-wrapper relative'>
<view class='name'>所在地区</view>
<view class="address">
<picker mode="multiSelector" @change="bindRegionChange"
@columnchange="bindMultiPickerColumnChange" :value="valueRegion" :range="multiArray">
<view class='acea-row'>
<view class="picker line1">{{region[0]}}{{region[1]}}{{region[2]}}</view>
<view class='iconfont icon-xiangyou abs_right'></view>
</view>
</picker>
</view>
</view>
<view class='item acea-row row-between-wrapper relative'>
<view class='name'>详细地址</view>
<input type='text' placeholder='请填写具体地址' placeholder-style="color:#ccc;" name='detail' placeholder-class='placeholder'
v-model='userAddress.detail' maxlength="18"></input>
<view class='iconfont icon-dizhi font-color abs_right' @tap="chooseLocation"></view>
</view>
</view>
<view class='default acea-row row-middle borRadius14'>
<checkbox-group @change='ChangeIsDefault'>
<checkbox :checked="userAddress.isDefault" />设置为默认地址
</checkbox-group>
</view>
<button class='keepBnt bg-color' form-type="submit">立即保存</button>
<!-- #ifdef MP -->
<view class="wechatAddress" v-if="!id" @click="getWxAddress">导入微信地址</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<view class="wechatAddress" v-if="this.$wechat.isWeixin() && !id" @click="getAddress">导入微信地址</view>
<!-- #endif -->
</view>
</form>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<!-- <home></home> -->
</view>
</template>
<script>
import {
editAddress,
getAddressDetail
} from '@/api/user.js';
import {
getCity
} from '@/api/api.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import home from '@/components/home';
// import city from '@/utils/cityData';
let app = getApp();
export default {
components: {
// #ifdef MP
authorize,
// #endif
home
},
data() {
return {
regionDval: ['浙江省', '杭州市', '滨江区'],
cartId: '', //购物车id
pinkId: 0, //拼团id
couponId: 0, //优惠券id
id: 0, //地址id
userAddress: {
isDefault: false
}, //地址详情
region: ['省', '市', '区'],
valueRegion: [0, 0, 0],
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
district: [],
multiArray: [],
multiIndex: [0, 0, 0],
cityId: 0,
defaultRegion: ['广东省', '广州市', '番禺区'],
defaultRegionCode: '440113',
bargain: false, //是否是砍价
combination: false, //是否是拼团
secKill: false, //是否是秒杀
};
},
computed: mapGetters(['isLogin']),
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getUserAddress();
this.getCityList();
}
},
deep: true
}
},
onLoad(options) {
if (this.isLogin) {
this.preOrderNo = options.preOrderNo || 0;
this.id = options.id || 0;
uni.setNavigationBarTitle({
title: options.id ? '修改地址' : '添加地址'
})
this.getUserAddress();
if(this.$Cache.has('cityList')){
//检测城市数据是否存在缓存,有的话从缓存取,没有的话请求接口
this.district = this.$Cache.getItem('cityList')
this.initialize();
}else{
this.getCityList();
}
} else {
toLogin();
}
},
methods: {
// #ifdef APP-PLUS
// 获取选择的地区
handleGetRegion(region) {
this.region = region
},
// #endif
// 获取地址数据
getCityList: function() {
let that = this;
getCity().then(res => {
this.district = res.data;
let oneDay = 24 * 3600 * 1000;
// this.$Cache.set('cityList', JSON.stringify(res.data)); //设置不过期时间的方法
this.$Cache.setItem({name:'cityList',value:res.data,expires:oneDay * 7}); //设置七天过期时间
that.initialize();
})
},
initialize: function() {
let that = this,province = [],city = [],area = [];
if (that.district.length) {
let cityChildren = that.district[0].child || [];
let areaChildren = cityChildren.length ? (cityChildren[0].child || []) : [];
that.district.forEach(function(item) {
province.push(item.name);
});
cityChildren.forEach(function(item) {
city.push(item.name);
});
areaChildren.forEach(function(item) {
area.push(item.name);
});
this.multiArray = [province, city, area]
}
},
bindRegionChange: function(e) {
let multiIndex = this.multiIndex,
province = this.district[multiIndex[0]] || {
child: []
},
city = province.child[multiIndex[1]] || {
cityId: 0
},
multiArray = this.multiArray,
value = e.detail.value;
this.region = [multiArray[0][value[0]], multiArray[1][value[1]], multiArray[2][value[2]]]
this.cityId = city.cityId
this.valueRegion = [0, 0, 0]
this.initialize();
},
bindMultiPickerColumnChange: function(e) {
let that = this,
column = e.detail.column,
value = e.detail.value,
currentCity = this.district[value] || {
child: []
},
multiArray = that.multiArray,
multiIndex = that.multiIndex;
multiIndex[column] = value;
switch (column) {
case 0:
let areaList = currentCity.child[0] || {
child: []
};
multiArray[1] = currentCity.child.map((item) => {
return item.name;
});
multiArray[2] = areaList.child.map((item) => {
return item.name;
});
break;
case 1:
let cityList = that.district[multiIndex[0]].child[multiIndex[1]].child || [];
multiArray[2] = cityList.map((item) => {
return item.name;
});
break;
case 2:
break;
}
// #ifdef MP || APP-PLUS
this.$set(this.multiArray, 0, multiArray[0]);
this.$set(this.multiArray, 1, multiArray[1]);
this.$set(this.multiArray, 2, multiArray[2]);
// #endif
// #ifdef H5
this.multiArray = multiArray;
// #endif
this.multiIndex = multiIndex
// this.setData({ multiArray: multiArray, multiIndex: multiIndex});
},
// 授权回调
onLoadFun: function() {
this.getUserAddress();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
toggleTab(str) {
this.$refs[str].show();
},
onConfirm(val) {
this.region = val.checkArr[0] + '-' + val.checkArr[1] + '-' + val.checkArr[2];
},
getUserAddress: function() {
if (!this.id) return false;
let that = this;
getAddressDetail(this.id).then(res => {
let region = [res.data.province, res.data.city, res.data.district];
that.$set(that, 'userAddress', res.data);
that.$set(that, 'region', region);
that.city_id = res.data.cityId
});
},
chooseLocation: function () {
uni.chooseLocation({
success: (res) => {
this.$set(this.userAddress,'detail',res.address.replace(/.+?(省|市|自治区|自治州|县|区)/g,''));
}
})
},
// 导入共享地址(小程序)
getWxAddress: function() {
let that = this;
uni.authorize({
scope: 'scope.address',
success: function(res) {
uni.chooseAddress({
success: function(res) {
let addressP = {};
addressP.province = res.provinceName;
addressP.city = res.cityName;
addressP.district = res.countyName;
addressP.cityId = 0;
editAddress({
address: addressP,
isDefault: 1,
realName: res.userName,
postCode: res.postalCode,
phone: res.telNumber,
detail: res.detailInfo,
id: 0
}).then(res => {
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
});
} else {
uni.navigateBack({
delta: 1
});
}
}, 1000);
return that.$util.Tips({
title: "添加成功",
icon: 'success'
});
}).catch(err => {
return that.$util.Tips({
title: err
});
});
},
fail: function(res) {
if (res.errMsg == 'chooseAddress:cancel') return that.$util
.Tips({
title: '取消选择'
});
},
})
},
fail: function(res) {
uni.showModal({
title: '您已拒绝导入微信地址权限',
content: '是否进入权限管理,调整授权?',
success(res) {
if (res.confirm) {
uni.openSetting({
success: function(res) {}
});
} else if (res.cancel) {
return that.$util.Tips({
title: '已取消!'
});
}
}
})
},
})
},
// 导入共享地址(微信);
getAddress() {
let that = this;
that.$wechat.openAddress().then(userInfo => {
// open();
editAddress({
id: this.id,
realName: userInfo.userName,
phone: userInfo.telNumber,
address: {
province: userInfo.provinceName,
city: userInfo.cityName,
district: userInfo.countryName,
cityId: 0
},
detail: userInfo.detailInfo,
isDefault: 1,
postCode: userInfo.postalCode
})
.then(() => {
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
});
} else {
uni.navigateTo({
url: '/pages/users/user_address_list/index'
})
// history.back();
}
}, 1000);
// close();
that.$util.Tips({
title: "添加成功",
icon: 'success'
});
})
.catch(err => {
// close();
return that.$util.Tips({
title: err || "添加失败"
});
});
}).catch(err => {
console.log(err);
});
},
/**
* 提交用户添加地址
*
*/
formSubmit: function(e) {
let that = this,
value = e.detail.value;
if (!value.realName) return that.$util.Tips({
title: '请填写收货人姓名'
});
if (!value.phone) return that.$util.Tips({
title: '请填写联系电话'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(value.phone)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (that.region == '省-市-区') return that.$util.Tips({
title: '请选择所在地区'
});
if (!value.detail) return that.$util.Tips({
title: '请填写详细地址'
});
value.id = that.id;
let regionArray = that.region;
value.address = {
province: regionArray[0],
city: regionArray[1],
district: regionArray[2],
cityId: that.cityId,
};
value.isDefault = that.userAddress.isDefault;
uni.showLoading({
title: '保存中',
mask: true
})
editAddress(value).then(res => {
if (that.id)
that.$util.Tips({
title: '修改成功',
icon: 'success'
});
else
that.$util.Tips({
title: '添加成功',
icon: 'success'
});
setTimeout(function() {
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();
// #endif
// #ifndef H5
return uni.navigateBack({
delta: 1,
})
// #endif
}
}, 1000);
}).catch(err => {
return that.$util.Tips({
title: err
});
})
},
ChangeIsDefault: function(e) {
this.$set(this.userAddress, 'isDefault', !this.userAddress.isDefault);
}
}
}
</script>
<style scoped lang="scss">
.addAddress {
padding-top: 20rpx;
}
.addAddress .list {
background-color: #fff;
padding: 0 24rpx;
}
.addAddress .list .item {
border-top: 1rpx solid #eee;
height: 90rpx;
line-height: 90rpx;
}
.addAddress .list .item .name {
// width: 195rpx;
font-size: 30rpx;
color: #333;
}
.addAddress .list .item .address {
flex: 1;
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 .picker {
width: 410rpx;
font-size: 30rpx;
}
.addAddress .default {
padding: 0 30rpx;
height: 90rpx;
background-color: #fff;
margin-top: 23rpx;
}
.addAddress .default checkbox {
margin-right: 15rpx;
}
.addAddress .keepBnt {
width: 690rpx;
height: 86rpx;
border-radius: 50rpx;
text-align: center;
line-height: 86rpx;
margin: 80rpx auto 24rpx auto;
font-size: 32rpx;
color: #fff;
}
.addAddress .wechatAddress {
width: 690rpx;
height: 86rpx;
border-radius: 50rpx;
text-align: center;
line-height: 86rpx;
margin: 0 auto;
font-size: 32rpx;
color: #E93323 ;
border: 1px solid #E93323;
}
.relative{
position: relative;
}
.icon-dizhi{
font-size: 44rpx;
z-index: 100;
}
.abs_right{
position: absolute;
right:0;
}
.status{
display: flex;
width: 750rpx;
// background-color: #E93323;
height: var(--status-bar-height);
}
</style>

View File

@@ -0,0 +1,477 @@
<template>
<view>
<!-- #ifdef APP-->
<view class='status_1'></view>
<!-- #endif -->
<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":""'>
<radio-group class="radio-group" @change="radioChange" v-if="addressList.length">
<view class='item borRadius14' v-for="(item,index) in addressList" :key="index">
<view class='address' @click='goOrder(item.id)'>
<view class='consignee'>收货人{{item.realName}}<text class='phone'>{{item.phone}}</text></view>
<view>收货地址{{item.province}}{{item.city}}{{item.district}}{{item.detail}}</view>
</view>
<view class='operation acea-row row-between-wrapper'>
<!-- #ifndef MP -->
<radio class="radio" :value="index.toString()" :checked="item.isDefault">
<text>设为默认</text>
</radio>
<!-- #endif -->
<!-- #ifdef MP -->
<radio class="radio" :value="index" :checked="item.isDefault">
<text>设为默认</text>
</radio>
<!-- #endif -->
<view class='acea-row row-middle'>
<view @click='editAddress(item.id)'><text class='iconfont icon-bianji'></text>编辑</view>
<view @click='delAddress(index)'><text class='iconfont icon-shanchu'></text>删除</view>
</view>
</view>
</view>
</radio-group>
<view class='loadingicon acea-row row-center-wrapper' v-if="addressList.length">
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view>
<view class='noCommodity' v-if="addressList.length < 1 && page > 1">
<view class='pictrue'>
<image src='../../../static/images/noAddress.png'></image>
</view>
</view>
<view style='height:120rpx;'></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 -->
<!-- #ifdef APP-->
<view class='addressBnt on bg-color' @click='addAddress'><text class='iconfont icon-tianjiadizhi'></text>添加新地址</view>
<!-- #endif -->
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
<script>
import {
getAddressList,
setAddressDefault,
delAddress,
editAddress,
postAddress
} from '@/api/user.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import home from '@/components/home';
export default {
components: {
// #ifdef MP
authorize,
// #endif
home
},
data() {
return {
addressList: [],
cartId: '',
pinkId: 0,
couponId: 0,
loading: false,
loadend: false,
loadTitle: '加载更多',
page: 1,
limit: 20,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
bargain: false, //是否是砍价
combination: false, //是否是拼团
secKill: false, //是否是秒杀
};
},
computed: mapGetters(['isLogin']),
watch:{
isLogin:{
handler:function(newV,oldV){
if(newV){
this.getUserAddress(true);
}
},
deep:true
}
},
onLoad(options) {
if (this.isLogin) {
this.preOrderNo = options.preOrderNo || 0;
// this.pinkId = options.pinkId || 0;
// this.couponId = options.couponId || 0;
// this.secKill = options.secKill || false;
// this.combination = options.combination || false;
// this.bargain = options.bargain || false;
this.getAddressList(true);
} else {
toLogin();
}
},
onShow: function() {
let that = this;
that.getAddressList(true);
},
methods: {
onLoadFun: function() {
this.getAddressList();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
/*
* 导入微信地址(小程序)
*/
getWxAddress: function() {
let that = this;
uni.authorize({
scope: 'scope.address',
success: function(res) {
uni.chooseAddress({
success: function(res) {
let addressP = {};
addressP.province = res.provinceName;
addressP.city = res.cityName;
addressP.district = res.countyName;
addressP.cityId = 0;
editAddress({
address: addressP,
isDefault: true,
realName: res.userName,
postCode: res.postalCode,
phone: res.telNumber,
detail: res.detailInfo,
id: 0
//type: 1//区别城市id导入微信地址无城市id需要后台自己查找;
}).then(res => {
that.$util.Tips({
title: "添加成功",
icon: 'success'
}, function() {
that.getAddressList(true);
});
}).catch(err => {
return that.$util.Tips({
title: err
});
});
},
fail: function(res) {
if (res.errMsg == 'chooseAddress:cancel') return that.$util.Tips({
title: '取消选择'
});
},
})
},
fail: function(res) {
uni.showModal({
title: '您已拒绝导入微信地址权限',
content: '是否进入权限管理,调整授权?',
success(res) {
if (res.confirm) {
uni.openSetting({
success: function(res) {
console.log(res.authSetting)
}
});
} else if (res.cancel) {
return that.$util.Tips({
title: '已取消!'
});
}
}
})
}
})
},
/*
* 导入微信地址(公众号)
*/
getAddress() {
let that = this;
that.$wechat.openAddress().then(userInfo => {
// open();
editAddress({
realName: userInfo.userName,
phone: userInfo.telNumber,
address: {
province: userInfo.provinceName,
city: userInfo.cityName,
district: userInfo.countryName,
cityId: 0
},
detail: userInfo.detailInfo,
postCode: userInfo.postalCode,
isDefault: true
})
.then(() => {
that.$util.Tips({
title: "添加成功",
icon: 'success'
}, function() {
// close();
that.getAddressList(true);
});
})
.catch(err => {
// close();
return that.$util.Tips({
title: err || "添加失败"
});
});
});
},
/**
* 获取地址列表
*
*/
getAddressList: function(isPage) {
let that = this;
if (isPage) {
that.loadend = false;
that.page = 1;
that.$set(that, 'addressList', []);
};
if (that.loading) return;
if (that.loadend) return;
that.loading = true;
that.loadTitle = '';
getAddressList({
page: that.page,
limit: that.limit
}).then(res => {
let list = res.data.list;
let loadend = list.length < that.limit;
that.addressList = that.$util.SplitArray(list, that.addressList);
that.$set(that, 'addressList', that.addressList);
that.loadend = loadend;
that.loadTitle = loadend ? '我也是有底线的' : '加载更多';
that.page = that.page + 1;
that.loading = false;
}).catch(err => {
that.loading = false;
that.loadTitle = '加载更多';
});
},
/**
* 设置默认地址
*/
radioChange: function(e) {
let index = parseInt(e.detail.value),
that = this;
let address = this.addressList[index];
if (address == undefined) return that.$util.Tips({
title: '您设置的默认地址不存在!'
});
setAddressDefault(address.id).then(res => {
for (let i = 0, len = that.addressList.length; i < len; i++) {
if (i == index) that.addressList[i].isDefault = true;
else that.addressList[i].isDefault = false;
}
that.$util.Tips({
title: '设置成功',
icon: 'success'
}, function() {
that.$set(that, 'addressList', that.addressList);
});
}).catch(err => {
return that.$util.Tips({
title: err
});
});
},
/**
* 编辑地址
*/
editAddress: function(id) {
let cartId = this.cartId,
pinkId = this.pinkId,
couponId = this.couponId;
this.cartId = '';
this.pinkId = '';
this.couponId = '';
uni.navigateTo({
url: '/pages/users/user_address/index?id=' + id + '&cartId=' + cartId + '&pinkId=' + pinkId + '&couponId=' +
couponId + '&secKill' + this.secKill + '&combination=' + this.combination + '&bargain=' + this.bargain
})
},
/**
* 删除地址
*/
delAddress: function(index) {
let that = this,
address = this.addressList[index];
if (address == undefined) return that.$util.Tips({
title: '您删除的地址不存在!'
});
delAddress(address.id).then(res => {
that.$util.Tips({
title: '删除成功',
icon: 'success'
}, function() {
that.addressList.splice(index, 1);
that.$set(that, 'addressList', that.addressList);
});
}).catch(err => {
return that.$util.Tips({
title: err
});
});
},
/**
* 新增地址
*/
addAddress: function() {
let cartId = this.cartId,
pinkId = this.pinkId,
couponId = this.couponId;
this.cartId = '';
this.pinkId = '';
this.couponId = '';
uni.navigateTo({
url: '/pages/users/user_address/index?preOrderNo=' + this.preOrderNo
})
},
goOrder: function(id) {
if(this.preOrderNo){
uni.redirectTo({
url: '/pages/users/order_confirm/index?is_address=1&preOrderNo=' + this.preOrderNo + '&addressId=' + id
})
}
}
},
onReachBottom: function() {
this.getAddressList();
}
}
</script>
<style lang="scss" scoped>
.address-management{
padding: 20rpx 30rpx;
}
.address-management.fff {
background-color: #fff;
height: 1300rpx
}
.line {
width: 100%;
height: 3rpx;
image {
width: 100%;
height: 100%;
display: block;
}
}
.address-management .item {
background-color: #fff;
padding: 0 20rpx;
margin-bottom: 20rpx;
}
.address-management .item .address {
padding: 35rpx 0;
border-bottom: 1rpx solid #eee;
font-size: 28rpx;
color: #282828;
}
.address-management .item .address .consignee {
font-size: 28rpx;
font-weight: bold;
margin-bottom: 8rpx;
}
.address-management .item .address .consignee .phone {
margin-left: 25rpx;
}
.address-management .item .operation {
height: 83rpx;
font-size: 28rpx;
color: #282828;
}
.address-management .item .operation .radio text {
margin-left: 13rpx;
}
.address-management .item .operation .iconfont {
color: #2c2c2c;
font-size: 35rpx;
vertical-align: -2rpx;
margin-right: 10rpx;
}
.address-management .item .operation .iconfont.icon-shanchu {
margin-left: 35rpx;
font-size: 38rpx;
}
.footer {
position: fixed;
width: 100%;
background-color: #fff;
bottom: 0;
height: 106rpx;
padding: 0 30rpx;
box-sizing: border-box;
}
.footer .addressBnt {
width: 330rpx;
height: 76rpx;
border-radius: 50rpx;
text-align: center;
line-height: 76rpx;
font-size: 30rpx;
color: #fff;
}
.footer .addressBnt.on {
width: 690rpx;
margin: 0 auto;
}
.footer .addressBnt .iconfont {
font-size: 35rpx;
margin-right: 8rpx;
vertical-align: -1rpx;
}
.footer .addressBnt.wxbnt {
background-color: #fe960f;
}
.status_1{
display: flex;
width: 750rpx;
// background-color: #E93323;
height: var(--status-bar-height);
}
</style>

View File

@@ -0,0 +1,130 @@
<template>
<view>
<view class="bill-details">
<view class="sign-record">
<z-paging ref="paging" v-model="dataList" @query="queryList">
<view class="list pad30" style="margin-bottom: 15rpx" v-for="(vo, index) in dataList" :key="index">
<view class="item">
<view class="listn borRadius14">
<view style="height: 130rpx;" class="itemn acea-row row-between-wrapper">
<view>
<view class="name line1">{{ vo.recordName }}</view>
<view v-if="vo.infoName" style="margin-bottom: 10rpx;">订单号{{ vo.infoName }}</view>
<view>{{ vo.createTime }}</view>
</view>
<view class="num">{{ vo.amount }}</view>
</view>
</view>
</view>
</view>
</z-paging>
</view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
<script>
import { getBillList, getUsersMoneyRecord } from '@/api/user.js';
import { toLogin } from '@/libs/login.js';
import { mapGetters } from 'vuex';
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import emptyPage from '@/components/emptyPage.vue';
import home from '@/components/home';
export default {
components: {
// #ifdef MP
authorize,
// #endif
emptyPage,
home
},
data() {
return {
dataList: [],
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
};
},
computed: mapGetters(['isLogin']),
onShow() {
if (this.isLogin) {
this.getUserBillList();
} else {
toLogin();
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.type = options.type;
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.getUserBillList();
},
methods: {
/**
* 授权回调
*/
onLoadFun: function () {
this.getUserBillList();
},
// 授权关闭
authColse: function (e) {
this.isShowAuth = e;
},
queryList(pageNo, pageSize) {
const params = {
page: pageNo,
limit: pageSize
};
getUsersMoneyRecord(params)
.then(({ data }) => {
this.$refs.paging.complete(data);
})
.catch((res) => {
this.$refs.paging.complete(false);
});
}
}
};
</script>
<style>
.zp-paging-container-content {
padding: 15rpx 0 !important;
}
</style>
<style scoped lang="scss">
.sign-record {
}
.bill-details .nav {
background-color: #fff;
height: 90rpx;
width: 100%;
line-height: 90rpx;
}
.bill-details .nav .item {
flex: 1;
text-align: center;
font-size: 30rpx;
color: #282828;
}
.bill-details .nav .item.on {
color: $theme-color;
border-bottom: 3rpx solid $theme-color;
}
</style>

View File

@@ -0,0 +1,251 @@
<template>
<view class="withdraw p30">
<view style="height: 30rpx"></view>
<view style="background-color: #ffffff; padding: 30rpx; border-radius: 10rpx; font-size: 30rpx; color: #949494">
<view>当前可提现余额 {{ userInfo.nowMoney }}</view>
</view>
<view style="height: 30rpx"></view>
<view class="withdraw_k" @click="toNav">
<view class="withdraw_k_tit">提现到</view>
<view class="withdraw_k_input">请选择银行卡</view>
<!-- <image class="withdraw_k_img" src="/static/icon/xia.png"></image> -->
</view>
<view v-if="bank">
<view style="background-color: #ffffff; border-radius: 12rpx; padding: 20rpx; margin-bottom: 20rpx">
<view style="font-size: 28rpx; display: flex; align-items: center">
<view>
<u-tag :text="bank.type == 1 ? '个人' : '企业'" size="mini" :type="bank.type == 1 ? 'success' : 'error'" plain plainFill></u-tag>
</view>
<view style="width: 30rpx"></view>
<view style="font-size: 26rpx">{{ bank.name }}</view>
<view style="width: 30rpx"></view>
<view style="font-size: 26rpx">{{ bank.phone || '' }}</view>
</view>
<view style="height: 20rpx"></view>
<view style="color: #232323">
<!-- <view style="font-size: 28rpx">开户行{{ bank.bankName }}</view>
<view style="height: 10rpx"></view> -->
<view style="font-size: 28rpx" v-if="bank.type == 2">开户行{{ bank.subbranchName }}</view>
<view style="height: 10rpx"></view>
<view style="font-size: 28rpx">银行卡号{{ bank.bankCard }}</view>
<view style="height: 10rpx"></view>
<!-- <view style="font-size: 28rpx" v-if="bank.type == 2">纳税人识别号{{ bank.taxNo ? maskCardNumber(bank.taxNo) : '' }}</view>
<view style="height: 10rpx"></view> -->
</view>
</view>
</view>
<view class="withdraw_mon">
<view class="withdraw_mon_tit">提现金额</view>
<view class="withdraw_mon_input">
<view class="withdraw_mon_input_fu"></view>
<view style="flex: 1">
<u-input fontSize="36rpx" placeholder="请输入金额" :border="false" v-model="dataFrom.amount"></u-input>
</view>
<!-- <view class="withdraw_mon_input_note" @click="dataFrom.points = getInfo.points1">全部提现</view> -->
</view>
<view>
<u-input :border="false" disabled v-model="userInfo.phone"></u-input>
</view>
<view class="withdraw_mon_input">
<u-input placeholder="请输入验证码" :border="false" v-model="dataFrom.smsCode"></u-input>
<view style="width: 250rpx">
<u-code ref="uCode" @change="codeChange2" keep-running start-text="获取验证码"></u-code>
<u-button @click="getCode" color="#E93323">{{ tips }}</u-button>
</view>
</view>
<!-- <view class="withdraw_mon_note">可提现金额{{ getInfo.points1 }}</view>
<view class="withdraw_mon_note">最小可提现金额为{{ appConfig.minMoney }}</view>
<view class="withdraw_mon_note">私户每100.00元提现手续费为{{ appConfig.free }}%</view> -->
</view>
<view class="withdraw_note">
<view class="withdraw_note_tit" style="font-weight: bold; font-size: 26rpx">提现规则</view>
<view class="withdraw_note_s" v-for="(item, index) in infoDateRlue" :key="index">{{ item }}</view>
</view>
<view style="height: 50rpx"></view>
<view style="display: flex; justify-content: center; margin-top: 80rpx">
<view class="affirm_btn" @click="payOrder">立即提现</view>
</view>
<view style="height: 50rpx"></view>
</view>
</template>
<script>
import { registerVerify, apply, extractRule } from '@/api/user';
import { mapGetters } from 'vuex';
export default {
data() {
return {
value: '',
getInfo: {},
tips: '',
dataFrom: {
amount: '',
smsCode: '',
bankCardId: ''
},
bank: null,
infoDateRlue: []
};
},
computed: mapGetters(['userInfo']),
onLoad() {
uni.$on('bank', (e) => {
console.log(e);
this.bank = e;
this.dataFrom.bankCardId = e.id;
});
extractRule().then((res) => {
this.infoDateRlue = res.data.ruleInfo;
console.log(res);
});
},
methods: {
toNav(e) {
uni.navigateTo({
url: '/pages/users/bank/cradList?type=xz'
});
},
codeChange2(text) {
this.tips = text;
},
getCode() {
if (!this.userInfo.phone) return uni.showToast({ title: '请输入手机号', icon: 'none' });
if (this.$refs.uCode.canGetCode) {
// 模拟向后端请求验证码
uni.showLoading({
title: '正在获取验证码'
});
registerVerify(this.userInfo.phone).then((res) => {
uni.hideLoading();
uni.$u.toast('验证码已发送');
this.$refs.uCode.start();
});
} else {
uni.$u.toast('倒计时结束后再发送');
}
},
maskCardNumber(cardNumber) {
if (!cardNumber || typeof cardNumber !== 'string') {
throw new Error('Invalid card number');
}
const sanitizedNumber = cardNumber.replace(/\D/g, '');
if (sanitizedNumber.length < 4) {
throw new Error('Card number is too short');
}
const lastFourDigits = sanitizedNumber.slice(-4);
const maskedNumber = '*'.repeat(sanitizedNumber.length - 4) + lastFourDigits;
return maskedNumber;
},
async payOrder() {
console.log(this.dataFrom);
if (!this.dataFrom.bankCardId) return uni.showToast({ title: '请先选择提现银行卡', icon: 'none' });
if (!this.dataFrom.amount) return uni.showToast({ title: '请输入提现金额', icon: 'none' });
if (!this.dataFrom.smsCode) return uni.showToast({ title: '请输入验证码', icon: 'none' });
let _res = await apply(this.dataFrom);
uni.showModal({
title: '提示',
content: '提交成功',
showCancel: false,
success() {
uni.navigateBack();
}
});
}
}
};
</script>
<style scoped lang="scss">
.withdraw {
&_k {
width: 100%;
height: 74rpx;
padding: 0 20rpx;
background: #ffffff;
border-radius: 8rpx 8rpx 8rpx 8rpx;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 30rpx;
&_tit {
font-weight: bold;
font-size: 24rpx;
color: #232323;
margin-right: 100rpx;
}
&_input {
flex: 1;
text-align: right;
font-size: 28rpx;
}
&_img {
width: 44rpx;
height: 44rpx;
}
}
&_mon {
padding: 20rpx;
background: #ffffff;
border-radius: 8rpx 8rpx 8rpx 8rpx;
&_tit {
font-weight: bold;
font-size: 24rpx;
color: #232323;
}
&_input {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 2rpx solid #cccccc;
padding: 15rpx 0;
margin-bottom: 20rpx;
&_fu {
font-weight: bold;
font-size: 66rpx;
color: #232323;
}
&_note {
font-weight: bold;
font-size: 24rpx;
color: #ff7777;
}
}
&_note {
font-weight: 400;
font-size: 24rpx;
color: #232323;
margin-bottom: 10rpx;
}
}
&_note {
margin-top: 30rpx;
padding: 0 15rpx;
view {
margin-bottom: 15rpx;
font-weight: 400;
font-size: 26rpx;
color: #232323;
line-height: 40rpx;
}
}
}
.affirm_btn {
width: 650rpx;
height: 78rpx;
background: #e93323;
border-radius: 12rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 24rpx;
color: #ffffff;
}
</style>

View File

@@ -0,0 +1,213 @@
<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' : ''">
<view><text class='num'>{{item.money?Number(item.money):''}}</text></view>
<view class="pic-num">{{ item.minPrice?Number(item.minPrice):'' }}元可用</view>
</view>
<view class='text'>
<view class='condition line2'>
<span class="line-title" :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart' ? 'bg-color-huic' : 'bg-color-check'" v-if="item.useType === 1">通用</span>
<span class="line-title" :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart' ? 'bg-color-huic' : 'bg-color-check'" v-else-if="item.useType === 2">商品</span>
<span class="line-title" :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart' ? 'bg-color-huic' : 'bg-color-check'" v-else-if="item.useType === 3">品类</span>
<span>{{item.name}}</span>
</view>
<view class='data acea-row row-between-wrapper'>
<view>{{item.useStartTimeStr}}~{{item.useEndTimeStr}}</view>
<view class='bnt' :class="item.validStr==='unusable'||item.validStr==='overdue'||item.validStr==='notStart'?'gray':'bg-color'">{{item.validStr | validStrFilter}}</view>
</view>
</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-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> -->
<!-- #endif -->
<home></home>
</view>
</template>
<script>
import {
getUserCoupons
} from '@/api/api.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import home from '@/components/home';
export default {
components: {
// #ifdef MP
authorize,
// #endif
home
},
filters: {
validStrFilter(status) {
const statusMap = {
'usable': '可用',
'unusable': '已用',
'overdue': '过期',
'notStart': '未开始'
}
return statusMap[status]
}
},
data() {
return {
couponsList: [],
loading: false,
loadend: false,
loadTitle: '加载更多',//提示语
page: 1,
limit: 20,
navOn: 'usable',
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
};
},
computed: mapGetters(['isLogin']),
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getUseCoupons();
}
},
deep: true
}
},
onLoad() {
if (this.isLogin) {
this.getUseCoupons();
} else {
toLogin();
}
},
methods: {
/**
* 授权回调
*/
onLoadFun: function() {
this.getUseCoupons();
},
// 授权关闭
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;
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 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;
justify-content: center;
}
.pic-num {
color: #ffffff;
font-size: 24rpx;
}
.coupon-list {
margin-top: 122rpx;
}
.coupon-list .item .text{
height: 100%;
}
.coupon-list .item .text .condition{
/* display: flex;
align-items: center; */
}
.condition .line-title {
width: 90rpx;
height: 40rpx !important;
line-height: 40rpx !important;
padding: 2rpx 10rpx;
-webkit-box-sizing: border-box;
box-sizing: border-box;
background: rgba(255, 247, 247, 1);
border: 1px solid rgba(232, 51, 35, 1);
opacity: 1;
border-radius: 20rpx;
font-size: 18rpx !important;
color: #e83323;
margin-right: 12rpx;
}
.noCommodity {
margin-top: 300rpx;
}
</style>

View File

@@ -0,0 +1,241 @@
<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" : "" '>
<view><text class='num'>{{item.money?Number(item.money):''}}</text></view>
<view class="pic-num">{{item.minPrice?Number(item.minPrice):''}}元可用</view>
</view>
<view class='text'>
<view class='condition line2'>
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":""'
v-if='item.useType===1'>通用</span>
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":""'
v-else-if='item.useType===3'>品类</span>
<span class='line-title' :class='(item.isUse==true || item.isUse==2)?"gray":""' v-else>商品</span>
<span>{{item.name}}</span>
</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 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'>
<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> -->
<!-- #endif -->
</view>
</template>
<script>
import {
getCoupons,
setCouponReceive
} from '@/api/api.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
export default {
components: {
// #ifdef MP
authorize
// #endif
},
data() {
return {
couponsList: [],
loading: false,
loadend: false,
loadTitle: '加载更多', //提示语
page: 1,
limit: 20,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
type: 1,
isShow: false,
navList: [{
type: 1,
name: '通用券',
count: 0
},
{
type: 2,
name: '商品券',
count: 0
},
{
type: 3,
name: '品类券',
count: 0
},
],
count: 0
};
},
computed: mapGetters(['isLogin']),
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getUseCoupons();
}
},
deep: true
}
},
onLoad() {
if (this.isLogin) {
this.getUseCoupons();
} else {
toLogin();
}
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
this.getUseCoupons();
},
methods: {
onLoadFun() {
this.getUseCoupons();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
getCoupon: function(id, index) {
let that = this;
let list = that.couponsList;
let ids = [];
ids.push(id);
//领取优惠券
setCouponReceive(id).then(function(res) {
list[index].isUse = true;
that.$set(that, 'couponsList', list);
that.$util.Tips({
title: '领取成功'
});
}, function(res) {
return that.$util.Tips({
title: res
});
})
},
/**
* 获取领取优惠券列表
*/
getUseCoupons: function() {
let that = this
if (that.loadend) return false;
if (that.loading) return false;
that.loading = true;
getCoupons({
page: that.page,
limit: that.limit,
type: that.type
}).then(res => {
let list = res.data,
loadend = list.length < that.limit;
let couponsList = that.$util.SplitArray(list, that.couponsList);
that.$set(that, 'couponsList', couponsList);
that.loadend = loadend;
that.loadTitle = loadend ? '我也是有底线的' : '加载更多';
that.page = that.page + 1;
that.loading = false;
that.isShow = true;
}).catch(err => {
that.loading = false;
that.loadTitle = '加载更多';
});
},
setType: function(type) {
if (this.type !== type) {
this.type = type;
this.couponsList = [];
this.page = 1;
this.loadend = false;
this.getUseCoupons();
}
}
}
}
</script>
<style scoped>
.nav {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 106rpx;
background-color: #FFFFFF;
font-size: 30rpx;
color: #999999;
z-index: 9;
}
.nav .acea-row {
border-top: 5rpx solid transparent;
border-bottom: 5rpx solid transparent;
cursor: pointer;
}
.nav .acea-row.on {
border-bottom-color: #E93323;
color: #E93323;
}
.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

@@ -0,0 +1,458 @@
<template>
<view>
<view class="hdbj"></view>
<view class='collectionGoods' v-if="collectProductList.length">
<!-- #ifdef H5 || MP-->
<view class='nav acea-row row-between-wrapper'>
<view>当前共 <text class='num font-color'>{{ totals }}</text>件商品</view>
<view class='administrate acea-row row-center-wrapper' @click='manage'>{{ footerswitch ? '管理' : '取消'}}
</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>
</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'>
<image src='../static/noCollection.png'></image>
</view>
<recommend :hostProduct="hostProduct"></recommend>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
<script>
import {
getCollectUserList,
getProductHot,
collectDelete
} from '@/api/store.js';
import {
mapGetters
} from "vuex";
import {
toLogin
} from '@/libs/login.js';
import recommend from '@/components/recommend';
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import home from '@/components/home';
export default {
components: {
recommend,
// #ifdef MP
authorize,
// #endif
home
},
data() {
return {
footerswitch: true,
hostProduct: [],
loadTitle: '加载更多',
loading: false,
loadend: false,
collectProductList: [],
limit: 8,
page: 1,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
hotScroll: false,
hotPage: 1,
hotLimit: 10,
isAllSelect: false, //全选
selectValue: [], //选中的数据
delBtnWidth: 80, //左滑默认宽度
totals: 0
};
},
computed: mapGetters(['isLogin']),
onLoad() {
if (this.isLogin) {
this.loadend = false;
this.page = 1;
this.collectProductList = [];
this.get_user_collect_product();
} else {
toLogin();
}
},
onShow() {
this.loadend = false;
this.page = 1;
this.collectProductList = [];
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();
}
},
/**
* 授权回调
*/
onLoadFun: function() {
this.get_user_collect_product();
this.get_host_product();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
/**
* 获取收藏产品
*/
get_user_collect_product: function() {
let that = this;
if (this.loading) return;
if (this.loadend) return;
that.loading = true;
that.loadTitle = "";
getCollectUserList({
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.$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;
that.loading = false;
}).catch(err => {
that.loading = false;
that.loadTitle = "加载更多";
});
},
/**
* 取消收藏
*/
delCollection: function(id, index) {
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'
});
// 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
})
});
},
/**
* 获取我的推荐
*/
get_host_product: function() {
let that = this;
if (that.hotScroll) return
getProductHot(
that.hotPage,
that.hotLimit,
).then(res => {
that.hotPage++
that.hotScroll = res.data.list.length < that.hotLimit
that.hostProduct = that.hostProduct.concat(res.data.list)
});
}
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
this.get_user_collect_product();
this.get_host_product();
}
}
</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 {
.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 {
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: 14rpx;
}
.collectionGoods .item .text {
width: 535rpx;
height: 130rpx;
font-size: 28rpx;
color: #282828;
}
.collectionGoods .item .text .name {
width: 100%;
}
.collectionGoods .item .text .money {
font-size: 26rpx;
}
.collectionGoods .item .text .delete {
font-size: 26rpx;
color: #282828;
width: 144rpx;
height: 46rpx;
border: 1px solid #bbb;
border-radius: 4rpx;
text-align: center;
line-height: 46rpx;
}
.noCommodity {
background-color: #fff;
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

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

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,518 @@
<template>
<view>
<view class="my-account">
<view class="wrapper">
<view class="header">
<view class="headerCon">
<view class="account acea-row row-top row-between">
<view class="assets">
<view>总资产()</view>
<view class="money">{{ statistics.nowMoney || 0 }}</view>
</view>
<!-- #ifdef H5 -->
<navigator url="/pages/users/user_payment/index" hover-class="none" class="recharge font-color">充值</navigator>
<!-- #endif -->
<!-- #ifdef MP -->
<view>
<view
v-if="userInfo.rechargeSwitch"
@click="openSubscribe('/pages/users/user_payment/index')"
style="margin-bottom: 20rpx"
class="recharge font-color"
>
充值
</view>
<!-- <view v-if="userInfo.rechargeSwitch" @click="openSubscribe('/pages/users/user_cash/index')" class="recharge font-color">提现</view> -->
</view>
<!-- #endif -->
</view>
<view class="cumulative acea-row row-top">
<!-- #ifdef H5 -->
<view class="item">
<view>累计充值()</view>
<view class="money">{{ statistics.recharge || 0 }}</view>
</view>
<!-- #endif -->
<!-- #ifdef MP -->
<view class="item" v-if="userInfo.rechargeSwitch">
<view>累计充值()</view>
<view class="money">{{ statistics.recharge || 0 }}</view>
</view>
<!-- #endif -->
<view class="item">
<view>累计消费()</view>
<view class="money">{{ statistics.orderStatusSum || 0 }}</view>
</view>
</view>
</view>
</view>
<view class="nav acea-row row-middle">
<navigator class="item" hover-class="none" url="/pages/users/user_bill/index?type=all">
<view class="pictrue">
<image src="../../../static/images/record1.png"></image>
</view>
<view>收支明细</view>
</navigator>
<!-- <navigator class="item" hover-class="none" url="/pages/users/user_bill/index?type=expenditure">
<view class="pictrue">
<image src="../../../static/images/record2.png"></image>
</view>
<view>消费记录</view>
</navigator>
<navigator class="item" hover-class="none" url="/pages/users/user_bill/index?type=income" v-if="userInfo.rechargeSwitch">
<view class="pictrue">
<image src="../../../static/images/record3.png"></image>
</view>
<view>充值记录</view>
</navigator> -->
<!-- <navigator class="item" hover-class="none" url="/pages/users/user_withdraw/index">
<view class="pictrue">
<image src="../../../static/images/record3.png"></image>
</view>
<view>提现记录</view>
</navigator> -->
<!-- <navigator class="item" hover-class="none" url="/pages/users/user_integral/index">
<view class="pictrue">
<image src="../../../static/images/record4.png"></image>
</view>
<view>积分中心</view>
</navigator> -->
</view>
<view class="mine_block" v-for="(item, index) in money_list" :key="index">
<view class="mine_block_tit">
<view class="mine_block_tit_left">{{ item.name }}</view>
</view>
<view class="mine_block_view u-flex-between">
<!-- <image mode="widthFix" src="/static/home/zu2.png"></image> -->
<view style="flex: 1;">
<view style="margin-bottom: 20rpx; display: flex; align-items: center; justify-content: space-between;flex: 1;">
<view style="width: 50%">
<view style="font-size: 30rpx">
<text style="color: #f64051">{{ item.data.day_money || 0 }}</text>
</view>
<view style="color: #999">今日{{ item.type }}</view>
</view>
<view style="width: 50%">
<view style="font-size: 30rpx">
<text style="color: #f64051">{{ item.data.week_money1 || 0 }}</text>
</view>
<view style="color: #999">上周{{ item.type }}</view>
</view>
</view>
<view style="display: flex; align-items: center; justify-content: space-between;flex: 1;">
<view style="width: 50%">
<view style="font-size: 30rpx">
<text style="color: #f64051">{{ item.data.week_money0 || 0 }}</text>
</view>
<view style="color: #999">本周{{ item.type }}</view>
</view>
<view style="width: 50%">
<view style="font-size: 30rpx">
<text style="color: #f64051">{{ item.data.total_money || 0 }}</text>
</view>
<view style="color: #999">30{{ item.type }}</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
<script>
import { getProductHot } from '@/api/store.js';
import { openRechargeSubscribe } from '@/utils/SubscribeMessage.js';
import { userActivity, getuserDalance, userStat } from '@/api/user.js';
import { toLogin } from '@/libs/login.js';
import { mapGetters } from 'vuex';
import recommend from '@/components/recommend/index';
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import home from '@/components/home';
export default {
components: {
recommend,
// #ifdef MP
authorize,
// #endif
home
},
data() {
return {
hostProduct: [],
isClose: false,
activity: {},
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
hotScroll: false,
statistics: {},
hotPage: 1,
hotLimit: 10,
money_list: [
{
name: '推广统计',
type: '推广',
data: {}
},
{
name: '邀请统计',
type: '邀请',
data: {}
}
]
};
},
computed: mapGetters(['isLogin', 'userInfo']),
watch: {
isLogin: {
handler: function (newV, oldV) {
if (newV) {
this.get_host_product();
this.get_activity();
this.userDalance();
}
},
deep: true
}
},
onLoad() {
if (this.isLogin) {
this.get_host_product();
this.get_activity();
this.userDalance();
} else {
toLogin();
}
userStat().then(({ data }) => {
this.money_list.map((item) => {
if (item.type == '推广') {
item.data = {
day_money: data.ordersToday,
week_money1: data.ordersLastWeek,
week_money0: data.ordersThisWeek,
total_money: data.orders30Days
};
}
if (item.type == '邀请') {
item.data = {
day_money: data.usersDay,
week_money1: data.usersLastWeek,
week_money0: data.usersThisWeek,
total_money: data.users30Days
};
}
});
});
},
methods: {
onLoadFun: function () {
this.get_host_product();
this.get_activity();
this.userDalance();
},
userDalance() {
getuserDalance().then((res) => {
this.statistics = res.data;
});
},
// 授权关闭
authColse: function (e) {
this.isShowAuth = e;
},
// #ifdef MP
openSubscribe: function (page) {
uni.showLoading({
title: '正在加载'
});
openRechargeSubscribe()
.then((res) => {
uni.hideLoading();
uni.navigateTo({
url: page
});
})
.catch(() => {
uni.hideLoading();
});
},
// #endif
/**
* 获取活动可参与否
*/
get_activity: function () {
// let that = this;
// userActivity().then(res => {
// that.$set(that, "activity", res.data);
// })
},
/**
* 获取我的推荐
*/
get_host_product: function () {
let that = this;
if (that.hotScroll) return;
getProductHot(that.hotPage, that.hotLimit).then((res) => {
that.hotPage++;
that.hotScroll = res.data.list.length < that.hotLimit;
that.hostProduct = that.hostProduct.concat(res.data.list);
});
}
},
onReachBottom() {
this.get_host_product();
}
};
</script>
<style scoped lang="scss">
.my-account .wrapper {
background-color: #fff;
padding: 32rpx 0 15rpx 0;
margin-bottom: 14rpx;
}
.my-account .wrapper .header {
width: 690rpx;
height: 330rpx;
background-image: linear-gradient(to right, #f33b2b 0%, #f36053 100%);
border-radius: 16rpx;
margin: 0 auto;
box-sizing: border-box;
color: rgba(255, 255, 255, 0.6);
font-size: 24rpx;
}
.my-account .wrapper .header .headerCon {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArIAAAFKCAYAAADhULxpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTggKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzMUM4RDlEM0YxNTExRTk4OUJFQ0Q4Qjg0RDBCMzQ1IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzMUM4RDlFM0YxNTExRTk4OUJFQ0Q4Qjg0RDBCMzQ1Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTMxQzhEOUIzRjE1MTFFOTg5QkVDRDhCODREMEIzNDUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTMxQzhEOUMzRjE1MTFFOTg5QkVDRDhCODREMEIzNDUiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6ymvxvAAAIhklEQVR42uzd0W6bQBCG0QWMwfj9nzfNKNBYVSq1iXH443MkXzfdGz6hYbZ7eXlpAACQpncEAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgAgZAEAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAEIWAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgAgZAEAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAEIWAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgAgZAEAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAEIWAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAACELAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQAQsgAAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAAIQsAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQBAyAIAIGQBAEDIAgCAkAUAQMgCAICQBQAAIQsAgJAFAAAhCwAAQhYAAIQsAABCFgAAhCwAAAhZAACELAAACFkAABCyAAAIWQAAELIAACBkAQBAyAIAIGQBAEDIAgCAkAUA4Ec7OQIAAIJ0r7/h9dcLWQAAjh6tt7/fEwVCFgCAw0frR4QsAADfoV9b9DZc/4uQBQDgkeG6xeuXlw4IWQAA9g7X+nX3/geELAAA99D9Ea67r3kVsgAAfFaNCIztfVzgoYQsAAD/6vat69h2GBcQsgAA3Et/E66HakchCwDAR/G6hethe1HIAgBwG6/1GxL+YCELAPC8ujVczynxKmQBAMTr4WZehSwAAH/rvnPb6XICIQsAwD31a7yO7QEXFAhZAAC+InruVcgCADyfob2/fe2e4T8sZAEAsm1vX5+u64QsAECebfa1ft2zHoKQBQDIUeMDU3t7C/v0hCwAwPGNa8AOjkLIAgAcXY0MbOMDveMQsgAAR2f+VcgCAMQF7LQGLEIWAODwfMAlZAEABKyQBQBgz4CddZiQBQAQsEIWAICdAtYIgZAFAIhRWwhmAStkAQBSdGvAWqMlZAEAYgJ22wPrIgMhCwAQoeJ1FrBCFgAgqaUqYAdHIWQBABLUh1wXLSVkAQBSbHOwk6MQsgAAKczBClkAgCg1/3pp5mCFLABACPtghSwAQJy6jevSjBEIWQCAELYRCFkAgDjbNgJvYYUsAEAEH3MJWQCAKHbCClkAgMgGqrewvaMQsgAACazUErIAAJHd4y2skAUAiFJvYc3CClkAgBg2EghZAIA49QZ2dgxCFgAghdu5hCwAQJxxjVi3cwlZAIAYFbDWaglZAIAYNUqwNB90CVkAgCD1BrY+6DJKIGQBACK4oQshCwDEMUqAkAUA4thKgJAFAOK4ZhYhCwBEqbevi25ByAIASYY1YntHgZAFAFLURoKLY0DIAgBJzMMiZAGAKOZhEbIAQJyag70287AIWQAgrEnqTaz9sAhZACCGj7oQsgBAHB91IWQBgDg1SjA6BoQsAJCi5mDro67BUSBkAYAUNhMgZAGAOMMasTYTIGQBgKjmsF4LIQsARBnXiAUhCwDEsCMWIQsAxKn9sLNjQMgCAElcdICQBQDi1CjB2TEgZAGAJG7r4mEsIwYARCxCFgAQsfAoRgsAgK+6agqELACQpG7pWvQE38VoAQDwWSIWIQsAxDFOgJAFAOJ4E4uQBQAiI9Z2AoQsACBiQcgCAHu6iFiELACQZn79nR0DQhYASDKtPxCyAECMegs7OwaELACQpOZhL44BIQsAJKkdsYtjQMgCAEkGEYuQBQASu6AitnMUCFkAIEXF61UbIGQBABELQhYA2FltJxgcA0IWAEhSe2JdPYuQBQCi1IUHbu1CyAIAUWpXrAsPELIAQNzz365YhCwAEGXbUGBXLEIWAIiyeP4jZAGANLWh4OQYELIAQBIbChCyAECcuuxgdgwIWQAgSX3UtTQfdyFkAYAwPu5CyAIAcXzchZAFAOKMzcddCFkAIPD57vpZhCwAEMXHXQhZACBSzcUOjgEhCwAkOa8/ELIAQNQz3aUHCFkAII65WIQsABCnNhSYi0XIAgBRal+suViELAAQ9xy3LxYhCwDEqYg1F4uQBQCi1PWzJ8eAkAUAktSHXVZtIWQdAQDEMRcLQhYA4riCFoQsAMSpmdjJMYCQBYAktZ3ASAEIWQCIM3tug5AFgDQ1UuD2LhCyABDFSAEIWQCINHleg5AFgDRDs6UAhCwABFocAQhZAEhjpACELABEPp9nxwBCFgDS2FIAQhYA4oztbW8sIGQBIIadsSBkASDSvMYsIGQBIEbtjHUNLQhZAIhjpACELADEqTexg2MAIQsASWom1s5YELIAEGdqPvACIQsAgc/hyTGAkAWAND7wAiELAHFOzQ1eIGQBIJAPvEDIAkAc67ZAyAJAHOu2QMgCQCTrtkDIAkCcCtizYwAhCwBp5uZtLAhZAAh85nobC0IWAOL4wAuELADEqVVbo2MAIQsAaSZHAEIWANJ4GwtCFgAimY2FnfwSYABJ5w5fwq1SbwAAAABJRU5ErkJggg==');
background-repeat: no-repeat;
background-size: 100%;
height: 100%;
width: 100%;
padding: 36rpx 0 29rpx 0;
box-sizing: border-box;
}
.my-account .wrapper .header .headerCon .account {
padding: 0 35rpx;
}
.my-account .wrapper .header .headerCon .account .assets .money {
font-size: 72rpx;
color: #fff;
font-family: 'Guildford Pro';
}
.my-account .wrapper .header .headerCon .account .recharge {
font-size: 28rpx;
width: 150rpx;
height: 54rpx;
border-radius: 27rpx;
background-color: #fff9f8;
text-align: center;
line-height: 54rpx;
}
.my-account .wrapper .header .headerCon .cumulative {
margin-top: 46rpx;
}
.my-account .wrapper .header .headerCon .cumulative .item {
flex: 1;
padding-left: 35rpx;
}
.my-account .wrapper .header .headerCon .cumulative .item .money {
font-size: 48rpx;
font-family: 'Guildford Pro';
color: #fff;
margin-top: 6rpx;
}
.my-account .wrapper .nav {
height: 155rpx;
border-bottom: 1rpx solid #f5f5f5;
}
.my-account .wrapper .nav .item {
flex: 1;
text-align: center;
font-size: 26rpx;
color: #999;
}
.my-account .wrapper .nav .item .pictrue {
width: 44rpx;
height: 44rpx;
margin: 0 auto;
margin-bottom: 20rpx;
}
.my-account .wrapper .nav .item .pictrue image {
width: 100%;
height: 100%;
}
.my-account .wrapper .advert {
padding: 0 30rpx;
margin-top: 30rpx;
}
.my-account .wrapper .advert .item {
background-color: #fff6d1;
width: 332rpx;
height: 118rpx;
border-radius: 10rpx;
padding: 0 27rpx 0 25rpx;
box-sizing: border-box;
font-size: 24rpx;
color: #e44609;
}
.my-account .wrapper .advert .item.on {
background-color: #fff3f3;
color: #e96868;
}
.my-account .wrapper .advert .item .pictrue {
width: 78rpx;
height: 78rpx;
}
.my-account .wrapper .advert .item .pictrue image {
width: 100%;
height: 100%;
}
.my-account .wrapper .advert .item .text .name {
font-size: 30rpx;
font-weight: bold;
color: #f33c2b;
margin-bottom: 7rpx;
}
.my-account .wrapper .advert .item.on .text .name {
color: #f64051;
}
.my-account .wrapper .list {
padding: 0 30rpx;
}
.my-account .wrapper .list .item {
margin-top: 44rpx;
}
.my-account .wrapper .list .item .picTxt .iconfont {
width: 82rpx;
height: 82rpx;
border-radius: 50%;
background-image: linear-gradient(to right, #ff9389 0%, #f9776b 100%);
text-align: center;
line-height: 82rpx;
color: #fff;
font-size: 40rpx;
}
.my-account .wrapper .list .item .picTxt .iconfont.yellow {
background-image: linear-gradient(to right, #ffccaa 0%, #fea060 100%);
}
.my-account .wrapper .list .item .picTxt .iconfont.green {
background-image: linear-gradient(to right, #a1d67c 0%, #9dd074 100%);
}
.my-account .wrapper .list .item .picTxt {
width: 428rpx;
font-size: 30rpx;
color: #282828;
}
.my-account .wrapper .list .item .picTxt .text {
width: 317rpx;
}
.my-account .wrapper .list .item .picTxt .text .infor {
font-size: 24rpx;
color: #999;
margin-top: 5rpx;
}
.my-account .wrapper .list .item .bnt {
font-size: 26rpx;
color: #282828;
width: 156rpx;
height: 52rpx;
border: 1rpx solid #ddd;
border-radius: 26rpx;
text-align: center;
line-height: 52rpx;
}
.my-account .wrapper .list .item .bnt.end {
font-size: 26rpx;
color: #aaa;
background-color: #f2f2f2;
border-color: #f2f2f2;
}
.mine_block {
padding: 24rpx;
background-color: #fff;
border-radius: 12rpx 12rpx 12rpx 12rpx;
margin-bottom: 20rpx;
&_tit {
display: flex;
align-items: center;
justify-content: space-between;
&_left {
font-weight: bold;
font-size: 28rpx;
color: #232323;
}
&_right {
display: flex;
align-items: center;
font-size: 24rpx;
color: #cbd73b;
image {
width: 13rpx;
height: 22rpx;
margin-left: 15rpx;
margin-top: 6rpx;
}
}
}
&_view {
width: 100%;
min-height: 120rpx;
border-radius: 12rpx 12rpx 12rpx 12rpx;
border: 2rpx solid rgba(55, 112, 174, 0.1);
margin-top: 16rpx;
display: flex;
align-items: center;
font-size: 28rpx;
color: #232323;
padding: 20rpx 30rpx;
text-align: center;
image {
width: 48rpx;
height: 48rpx;
margin-right: 25rpx;
}
}
}
</style>

View File

@@ -0,0 +1,538 @@
<template>
<view>
<form @submit="submitSub" report-submit='true'>
<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>
</view>
</view>
<view class="payment">
<view class="nav acea-row row-around row-middle">
<view class="item" :class="active==index?'on':''" v-for="(item,index) in navRecharge" :key="index" @click="navRecharges(index)">{{item}}</view>
</view>
<view class='tip picList' v-if='!active'>
<!-- <view class="pic-box pic-box-color acea-row row-center-wrapper row-column" :class="activePic === index ? 'pic-box-color-active' : ''"
v-for="(item, index) in picList" :key="index" @click="picCharge(index, item)">
<view class="pic-number-pic">
{{ item.price }}<span class="pic-number"> </span>
</view>
<view class="pic-number">赠送{{ item.giveMoney }} </view>
</view> -->
<view style="width: 100%;" class="pic-box pic-box-color acea-row row-center-wrapper" :class="parseFloat(activePic)===parseFloat(picList.length)?'pic-box-color-active':''" @click="picCharge(picList.length)">
<input type="number" placeholder="请输入充值金额" v-model="money" :maxlength="50000" class="pic-box-money pic-number-pic uni-input" :class="parseFloat(activePic) === parseFloat(picList.length) ? 'pic-box-color-active' : ''" />
</view>
<view class="tips-box">
<view class="tips mt-30">注意事项</view>
<view class="tips-samll" v-for="item in rechargeAttention" :key="item">
{{ item }}
</view>
</view>
</view>
<view class="tip" v-else>
<view class='input'><text></text><input placeholder="0.00" type='number' placeholder-class='placeholder' :value="number"
name="number"></input></view>
<view class="tips-title">
<view style="font-weight: bold; font-size: 26rpx;">提示</view>
<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>
<view class="tips-samll" v-for="item in rechargeAttention" :key="item">
{{ item }}
</view>
</view>
</view>
<button class='but' formType="submit"> {{active ? '立即转入': '立即充值' }}</button>
</view>
</form>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
<script>
import {
rechargeRoutine,
rechargeWechat,
getRechargeApi,
transferIn,
appWechat
} from '@/api/user.js';
import { wechatQueryPayResult } from '@/api/order.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import home from '@/components/home';
export default {
components: {
// #ifdef MP
authorize,
// #endif
home
},
data() {
let that = this;
return {
now_money: 0,
// 佣金转入
navRecharge: ['账户充值'],
active: 0,
number: '',
placeholder: "0.00",
from: '',
isAuto: false, //没有授权的不会自动授权
isShowAuth: false, //是否隐藏授权
picList: [],
activePic: 0,
money: "",
numberPic: '',
rechar_id: 0,
rechargeAttention: []
};
},
computed: mapGetters(['isLogin', 'systemPlatform','userInfo']),
watch:{
isLogin:{
handler:function(newV,oldV){
if(newV){
this.getRecharge();
}
},
deep:true
}
},
onLoad(options) {
// #ifdef H5
this.from = this.$wechat.isWeixin() ? "public" : "weixinh5";
// #endif
if (this.isLogin) {
this.getRecharge();
} else {
toLogin();
}
},
methods: {
/**
* 选择金额
*/
picCharge(idx, item) {
console.log(idx);
console.log(item);
this.activePic = idx;
if (item === undefined) {
this.rechar_id = 0;
this.numberPic = "";
} else {
this.money = "";
this.rechar_id = item.id;
this.numberPic = item.price;
}
},
/**
* 充值额度选择
*/
getRecharge() {
getRechargeApi()
.then(res => {
this.picList = res.data.rechargeQuota;
if (this.picList[0]) {
this.rechar_id = this.picList[0].id;
this.numberPic = this.picList[0].price;
}
this.rechargeAttention = res.data.rechargeAttention || [];
})
.catch(res => {
this.$dialog.toast({
mes: res
});
});
},
onLoadFun: function() {
this.getRecharge();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
navRecharges: function(index) {
this.active = index;
},
/*
* 用户充值
*/
submitSub: function(e) {
let that = this
let value = e.detail.value.number;
// 转入余额
if (that.active) {
if (parseFloat(value) < 0 || parseFloat(value) == NaN || value == undefined || value == "") {
return that.$util.Tips({
title: '请输入金额'
});
}
uni.showModal({
title: '转入余额',
content: '转入余额后无法再次转出,确认是否转入余额',
success(res) {
if (res.confirm) {
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'
}, {
tab: 5,
url: '/pages/users/user_money/index'
});
}).catch(err=>{
return that.$util.Tips({
title: err
});
})
} else if (res.cancel) {
return that.$util.Tips({
title: '已取消'
});
}
},
})
} else {
uni.showLoading({
title: '正在支付',
})
let money = parseFloat(this.money);
if (this.rechar_id == 0) {
if (Number.isNaN(money)) {
return that.$util.Tips({
title: '充值金额必须为数字'
});
}
if (money <= 0) {
return that.$util.Tips({
title: '充值金额不能为0'
});
}
if (money > 50000) {
return that.$util.Tips({
title: '充值金额最大值为50000'
});
}
} else {
money = this.numberPic
}
// #ifdef MP
rechargeRoutine({
price: money,
type: 0,
rechar_id: this.rechar_id
}).then(res => {
uni.hideLoading();
let jsConfig = res.data.data.jsConfig;
uni.requestPayment({
timeStamp: jsConfig.timeStamp,
nonceStr: jsConfig.nonceStr,
package: jsConfig.packageVal,
signType: jsConfig.signType,
paySign: jsConfig.paySign,
success: function(res) {
that.$store.commit("changInfo", {
amount1: 'nowMoney',
amount2: that.$util.$h.Add(value, that.userinfo.nowMoney)
});
//that.$set(that, 'userinfo.nowMoney', that.$util.$h.Add(value, that.userinfo.nowMoney));
return that.$util.Tips({
title: '支付成功',
icon: 'success'
}, {
tab: 5,
url: '/pages/users/user_money/index'
});
},
fail: function(err) {
console.log(err);
return that.$util.Tips({
title: '支付失败'
});
},
complete: function(res) {
if (res.errMsg == 'requestPayment:cancel') return that.$util.Tips({
title: '取消支付'
});
}
})
}).catch(err => {
uni.hideLoading();
return that.$util.Tips({
title: err
})
});
// #endif
// #ifdef H5
rechargeWechat({
price: money,
from: that.from,
rechar_id: that.rechar_id,
payType: 0
}).then(res => {
let jsConfig = res.data.jsConfig;
let orderNo = res.data.orderNo;
let data = {
timestamp:jsConfig.timeStamp,
nonceStr:jsConfig.nonceStr,
package:jsConfig.packages,
signType:jsConfig.signType,
paySign:jsConfig.paySign
};
if (that.from == "weixinh5") {
let domain = encodeURIComponent(location.href.split('/pages')[0]);
let urls = jsConfig.mwebUrl + '&redirect_url='+ domain + '/pages/users/user_money/index';
location.replace(urls);
return that.$util.Tips({
tab: 5,
url: '/pages/users/user_money/index'
});
// return that.$util.Tips({
// title: '支付成功',
// icon: 'success'
// }, {
// tab: 5,
// url: '/pages/users/user_money/index'
// });
} else {
that.$wechat.pay(data)
.finally(() => {
that.$store.commit("changInfo", {
amount1: 'nowMoney',
amount2: that.$util.$h.Add(value, that.userinfo.nowMoney)
});
// that.$set(that, 'userinfo.nowMoney', that.$util.$h.Add(value, that.userinfo.nowMoney));
// return that.$util.Tips({
// title: '支付成功',
// icon: 'success'
// }, {
// tab: 5,
// url: '/pages/users/user_money/index'
// });
wechatQueryPayResult(orderNo).then(res => {
return that.$util.Tips({
title: '支付成功',
icon: 'success'
}, {
tab: 5,
url: '/pages/users/user_money/index'
});
}).cache(err => {
return that.$util.Tips({
title: err
});
})
})
.catch(function(err) {
return that.$util.Tips({
title: '支付失败'
});
});
}
}).catch(res=>{
uni.hideLoading();
return that.$util.Tips({
title: res
});
})
// #endif
}
}
}
}
</script>
<style lang="scss">
page {
width: 100%;
height: 100%;
background-color: #fff;
}
.payment {
position: relative;
top: -60rpx;
width: 100%;
background-color: #fff;
border-radius: 10rpx;
padding-top: 25rpx;
border-top-right-radius: 14rpx;
border-top-left-radius: 14rpx;
}
.payment .nav {
height: 75rpx;
line-height: 75rpx;
padding: 0 100rpx;
}
.payment .nav .item {
font-size: 30rpx;
color: #333;
}
.payment .nav .item.on {
font-weight: bold;
border-bottom: 4rpx solid #e83323;
}
.payment .input {
display: flex;
align-items: center;
justify-content: center;
border-bottom: 1px dashed #dddddd;
margin: 60rpx auto 0 auto;
padding-bottom: 20rpx;
font-size: 56rpx;
color: #333333;
flex-wrap: nowrap;
}
.payment .input text {
padding-left: 106rpx;
}
.payment .input input {
padding-right: 106rpx;
width: 300rpx;
height: 94rpx;
text-align: center;
font-size: 70rpx;
}
.payment .placeholder {
color: #d0d0d0;
height: 100%;
line-height: 94rpx;
}
.payment .tip {
font-size: 26rpx;
color: #888888;
padding: 0 30rpx;
margin-top: 25rpx;
}
.payment .but {
color: #fff;
font-size: 30rpx;
width: 700rpx;
height: 86rpx;
border-radius: 43rpx;
margin: 50rpx auto 0 auto;
background: linear-gradient(90deg, #FF7931 0%, #F11B09 100%);
line-height: 86rpx;
}
.payment-top {
width: 100%;
height: 350rpx;
background-color: #e83323;
.name {
font-size: 26rpx;
color: rgba(255, 255, 255, 0.8);
margin-top: -38rpx;
margin-bottom: 30rpx;
}
.pic {
font-size: 32rpx;
color: #fff;
}
.pic-font {
font-size: 78rpx;
color: #fff;
}
}
.picList {
display: flex;
flex-wrap: wrap;
margin: 30rpx 0;
.pic-box {
width: 32%;
height: auto;
border-radius: 20rpx;
margin-top: 21rpx;
padding: 20rpx 0;
margin-right: 12rpx;
&:nth-child(3n) {
margin-right: 0;
}
}
.pic-box-color {
background-color: #f4f4f4;
color: #656565;
}
.pic-number {
font-size: 22rpx;
}
.pic-number-pic {
font-size: 38rpx;
margin-right: 10rpx;
text-align: center;
}
}
.pic-box-color-active {
// background-color: #ec3323 !important;
// color: #fff !important;
}
.tips-box {
.tips {
font-size: 28rpx;
color: #333333;
font-weight: 800;
margin-bottom: 14rpx;
margin-top: 20rpx;
}
.tips-samll {
font-size: 24rpx;
color: #333333;
margin-bottom: 14rpx;
}
.tip-box {
margin-top: 30rpx;
}
}
.tips-title {
margin-top: 20rpx;
font-size: 24rpx;
color: #333;
}
</style>

View File

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

View File

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

View File

@@ -0,0 +1,192 @@
<template>
<view>
<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='items.image'></image>
</view>
<view class='text'>
<view class='acea-row row-between-wrapper'>
<view class='name line1'>{{items.storeName}}</view>
<view class='num'>x {{items.cartNum}}</view>
</view>
<view class='attr line1' v-if="items.suk">{{items.suk}}</view>
<view class='attr line1' v-else>{{items.storeName}}</view>
<view class='money'>{{items.price}}</view>
</view>
</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' 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> -->
<!-- #endif -->
<home></home>
</view>
</template>
<script>
import home from '@/components/home';
import emptyPage from '@/components/emptyPage.vue'
import {
getOrderList
} from '@/api/order.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
export default {
components: {
emptyPage,
home,
// #ifdef MP
authorize
// #endif
},
data() {
return {
loading: false,
loadend: false,
loadTitle: '加载更多', //提示语
orderList: [], //订单数组
orderStatus: -3, //订单状态
page: 1,
limit: 20,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
};
},
computed: mapGetters(['isLogin']),
watch:{
isLogin:{
handler:function(newV,oldV){
if(newV){
this.getOrderList();
}
},
deep:true
}
},
onLoad() {
if (this.isLogin) {
this.getOrderList();
} else {
toLogin();
}
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
this.getOrderList();
},
methods: {
onLoadFun() {
this.getOrderList();
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
/**
* 去订单详情
*/
goOrderDetails: function(order_id) {
if (!order_id) return that.$util.Tips({
title: '缺少订单号无法查看订单详情'
});
uni.navigateTo({
url: '/pages/order_details/index?order_id=' + order_id + '&isReturen=1'
})
},
/**
* 获取订单列表
*/
getOrderList: function() {
let that = this;
if (that.loadend) return;
if (that.loading) return;
that.loading = true;
that.loadTitle = "";
getOrderList({
type: that.orderStatus,
page: that.page,
limit: that.limit,
}).then(res => {
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);
that.loadend = loadend;
that.loading = false;
that.loadTitle = loadend ? "我也是有底线的" : '加载更多';
that.page = that.page + 1;
}).catch(err => {
that.loading = false;
that.loadTitle = "加载更多";
});
}
}
}
</script>
<style lang="scss" scoped>
.return-list .goodWrapper {
background-color: #fff;
margin-top: 20rpx;
position: relative;
padding: 0rpx 24rpx;
}
.return-list .goodWrapper .orderNum {
border-bottom: 1px solid #eee;
height: 87rpx;
line-height: 87rpx;
font-size: 30rpx;
color: #333333;
}
.return-list .goodWrapper .item {
border-bottom: 0;
}
.return-list .goodWrapper .totalSum {
padding: 0 30rpx 32rpx 30rpx;
text-align: right;
font-size: 26rpx;
color: #282828;
}
.return-list .goodWrapper .totalSum .price {
font-size: 28rpx;
font-weight: bold;
}
.return-list .goodWrapper .iconfont {
position: absolute;
font-size: 109rpx;
top: 7rpx;
right: 22rpx;
color: #ccc;
}
.return-list .goodWrapper .iconfont.powder {
color: #f8c1bd;
}
</style>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,113 @@
<template>
<view>
<view class='sign-record'>
<view class='list pad30' v-for="(item,index) in signList" :key="index">
<view class='item'>
<view class='data'>{{item.month}}</view>
<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.createDay}}</view>
</view>
<view class='num font-color'>+{{itemn.number}}</view>
</view>
</view>
</view>
</view>
<view class='loadingicon acea-row row-center-wrapper'>
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadtitle}}
</view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
<script>
import { getSignMonthList } from '@/api/user.js';
import { toLogin } from '@/libs/login.js';
import { mapGetters } from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
export default {
components: {
// #ifdef MP
authorize
// #endif
},
data() {
return {
loading:false,
loadend:false,
loadtitle:'加载更多',
page:1,
limit:8,
signList:[],
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
};
},
computed: mapGetters(['isLogin']),
watch:{
isLogin:{
handler:function(newV,oldV){
if(newV){
this.getSignMoneList();
}
},
deep:true
}
},
onLoad(){
if(this.isLogin){
this.getSignMoneList();
}else{
toLogin();
}
},
onReachBottom: function () {
this.getSignMoneList();
},
methods: {
/**
*
* 授权回调
*/
onLoadFun:function(){
this.getSignMoneList();
},
// 授权关闭
authColse:function(e){
this.isShowAuth = e
},
/**
* 获取签到记录列表
*/
getSignMoneList:function(){
let that=this;
if(that.loading) return;
if(that.loadend) return;
that.loading = true;
that.loadtitle = "";
getSignMonthList({ page: that.page, limit: that.limit }).then(res=>{
let list = res.data.list;
let loadend = list.length < that.limit;
that.signList = that.$util.SplitArray(list, that.signList);
that.$set(that,'signList',that.signList);
that.loadend = loadend;
that.loading = false;
that.loadtitle = loadend ? "哼😕~我也是有底线的~" : "加载更多"
}).catch(err=>{
that.loading = false;
that.loadtitle = '加载更多';
});
},
}
}
</script>
<style>
</style>

View File

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

View File

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,117 @@
<template>
<view class="earnings p30" style="width: 100%">
<z-paging ref="paging" v-model="dataList" @query="queryList">
<view class="mt30 wallet_list" v-for="(item, index) in dataList" :key="index">
<view class="wallet_list_left">
<view>{{ item.type == 1 ? '提现人' : '提现公司' }}{{ item.name }}</view>
<view>银行名称{{ item.bankName }}</view>
<view v-if="item.subbranchName">支行名称{{ item.subbranchName }}</view>
<view>银行卡号{{ item.bankCard }}</view>
<view>提现时间{{ item.createTime }}</view>
<view>处理时间{{ item.completeTime ? item.completeTime : '-' }}</view>
<view>处理结果{{ item.handleMessage || '-' }}</view>
</view>
<view class="wallet_list_right" style="display: flex; flex-direction: column; align-items: flex-end; height: 320rpx">
<view style="margin-bottom: 100rpx">
<view></view>
<u-tag v-if="item.status == 0" size="mini" text="申请中" type="warning" plain plainFill></u-tag>
<u-tag v-if="item.status == 1" size="mini" type="success" text="提现成功" plain plainFill></u-tag>
<u-tag v-if="item.status == -1" size="mini" type="error" text="失败" plain plainFill></u-tag>
</view>
<view>{{ item.amount }}</view>
</view>
</view>
</z-paging>
</view>
</template>
<script>
import { getWithdraw } from '@/api/user.js';
export default {
data() {
return {
dataList: []
};
},
methods: {
queryList(pageNo, pageSize) {
const params = {
page: pageNo,
limit: pageSize
};
getWithdraw(params)
.then((res) => {
console.log(res);
this.$refs.paging.complete(res.data);
})
.catch((err) => {
console.log(err);
this.$refs.paging.complete(false);
});
}
}
};
</script>
<style>
.zp-paging-container-content {
padding: 30rpx !important;
}
</style>
<style scoped lang="scss">
.wallet_pall {
width: 690rpx;
height: 272rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
padding: 40rpx;
background: #ffffff;
&_header {
font-weight: bold;
font-size: 26rpx;
color: #002ea4;
}
&_ye {
display: flex;
align-items: center;
justify-content: space-between;
height: 70%;
view:nth-child(1) {
font-weight: bold;
font-size: 68rpx;
color: #002ea4;
}
view:nth-child(2) {
width: 128rpx;
height: 58rpx;
background: rgba(0, 46, 164, 0.07);
border-radius: 32rpx 32rpx 32rpx 32rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
color: #002ea4;
}
}
}
.wallet_list {
width: 690rpx;
background: #ffffff;
border-radius: 8rpx 8rpx 8rpx 8rpx;
padding: 15rpx 30rpx;
@include flex($space: space-between);
&_left {
view {
font-size: 28rpx;
color: #232323;
margin-bottom: 10rpx;
}
}
&_right {
font-weight: bold;
font-size: 28rpx;
color: #ff2727;
}
}
</style>

View File

@@ -0,0 +1,111 @@
<template>
<view class="order p30">
<z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
<view style="height: 20rpx"></view>
<view style="background-color: #ffffff; padding: 20rpx">邀请人数{{ total }}</view>
<view style="height: 20rpx"></view>
<view>
<view
v-for="(item, index) in dataList"
:key="index"
style="background-color: #ffffff; border-radius: 10rpx; padding: 30rpx; margin-bottom: 20rpx; font-size: 30rpx"
@click="toNav(item)"
>
<view style="display: flex; align-items: center">
<u-image width="100rpx" height="100rpx" :src="item.avatar" shape="circle"></u-image>
<view style="width: 20rpx"></view>
<view>
<view>{{ item.nickname }}</view>
<view style="height: 10rpx"></view>
<view>{{ item.account }}</view>
</view>
</view>
<u-divider></u-divider>
<view style="display: flex; justify-content: space-between">
<view>
<view>推广人数{{ item.childCount || 0 }}</view>
<view>订单金额{{ item.numberCount || 0 }}</view>
<view>订单数量{{ item.orderCount || 0 }}</view>
</view>
<view style="width: 20rpx"></view>
<view>
<view>手机号{{ item.phone || '-' }}</view>
<view style="height: 10rpx"></view>
<view>等级v{{ item.levelRatio }}</view>
</view>
</view>
<view style="height: 16rpx"></view>
<view>注册时间{{ item.time }}</view>
</view>
</view>
</z-paging>
</view>
</template>
<script>
import { shareList } from '@/api/user.js';
export default {
name: 'login_mobile',
data() {
return {
dataList: [],
total: 0,
dataFrom: {
type: 1
},
list: [
{
name: '直推',
id: 1
},
{
name: '间推',
id: 2
}
]
};
},
methods: {
toNav(e) {
uni.navigateTo({
url: './info?id=' + e.uid
});
},
queryList(pageNo, pageSize) {
const params = {
page: pageNo,
limit: pageSize,
...this.dataFrom
};
shareList(params)
.then((res) => {
this.$refs.paging.complete(res.data.list);
this.total = res.data.total;
})
.catch((res) => {
this.$refs.paging.complete(false);
});
}
},
isPagingRefNotFound() {
return !this.$refs.paging;
},
onPullDownRefresh() {
if (isPagingRefNotFound()) return;
this.$refs.paging.updatePageScrollTop(e.scrollTop);
e.scrollTop < 10 && this.$refs.paging.doChatRecordLoadMore();
},
onPageScroll() {
if (isPagingRefNotFound()) return;
this.$refs.paging.updatePageScrollTop(e.scrollTop);
e.scrollTop < 10 && this.$refs.paging.doChatRecordLoadMore();
},
onReachBottom() {
if (isPagingRefNotFound()) return;
this.$refs.paging.pageReachBottom();
}
};
</script>
<style scoped lang="scss"></style>

View File

@@ -0,0 +1,304 @@
<template>
<view class="xkl-com-bg">
<view style="height: 20rpx"></view>
<view style="background-color: #ffffff; border-radius: 10rpx; padding: 30rpx; font-size: 30rpx">
<view style="display: flex; align-items: center">
<u-image width="100rpx" height="100rpx" :src="shopinfo.avatar" shape="circle"></u-image>
<view style="width: 20rpx"></view>
<view>
<view>{{ shopinfo.nickname }}</view>
<view style="height: 10rpx"></view>
<view>{{ shopinfo.account }}</view>
</view>
</view>
<u-divider></u-divider>
<view style="display: flex; justify-content: space-between">
<view>
<view>推广人数{{ shopinfo.childCount || 0 }}</view>
<view>订单金额{{ shopinfo.numberCount || 0 }}</view>
<view>订单数量{{ shopinfo.orderCount || 0 }}</view>
</view>
<view style="width: 20rpx"></view>
<view>
<view>手机号{{ shopinfo.phone || '-' }}</view>
<view style="height: 10rpx"></view>
<view>等级{{ shopinfo.levelRatio }}</view>
</view>
</view>
<view style="height: 16rpx"></view>
<view style="display: flex; align-items: center; justify-content: space-between">
<view>注册时间{{ shopinfo.createTime }}</view>
<view>
<u-button @click="show = true" type="primary" size="small" color="#f33c2b" :plain="true" text="修改等级"></u-button>
</view>
</view>
</view>
<view style="height: 20rpx"></view>
<view style="background-color: #ffffff; border-radius: 10rpx; padding: 30rpx; font-size: 30rpx">
<view style="display: flex; align-items: center">
<view style="background-color: #ffffff; border-radius: 12rpx; padding: 10rpx" :class="search.weekType === 1 ? 'xkl_cur' : 'xkl_no'" @click="checkweek(1)">
本周
</view>
<view style="width: 30rpx"></view>
<view style="background-color: #ffffff; border-radius: 12rpx; padding: 10rpx" :class="search.weekType == 2 ? 'xkl_cur' : 'xkl_no'" @click="checkweek(2)">上周</view>
<view style="width: 30rpx"></view>
<view>
<uni-datetime-picker v-model="single" type="daterange" @change="maskClick">
<view style="background-color: #ffffff; border-radius: 12rpx; padding: 10rpx" :class="search.weekType === '' ? 'xkl_cur' : 'xkl_no'">
<text v-if="search.startTime">{{ search.startTime }} - {{ search.endTime }}</text>
<text v-else>自定义时间</text>
</view>
</uni-datetime-picker>
</view>
<!-- <view
@click="screen.showcalendar = true"
style="background-color: #ffffff; border-radius: 12rpx; padding: 10rpx"
:class="search.week === '' ? 'xkl_cur' : 'xkl_no'"
>
<text v-if="search.startTime">{{ search.startTime }} - {{ search.endTime }}</text>
<text v-else>自定义时间</text>
</view> -->
</view>
<view style="margin-top: 30rpx; display: flex; align-items: center">
<view
v-for="(item, index) in getDateRanges()"
:key="index"
style="background-color: #ffffff; border-radius: 12rpx; padding: 10rpx; margin-right: 30rpx"
:class="search.week === item.name ? 'xkl_cur' : 'xkl_no'"
@click="checkTime(item)"
>
{{ item.name }}
</view>
</view>
<u-divider></u-divider>
<view style="height: 20rpx"></view>
<qiun-data-charts type="line" :opts="opts" :chartData="chartData" />
</view>
<u-picker :show="show" :columns="columns" keyName="name" @cancel="show = false" @confirm="confirm"></u-picker>
<view style="height: 100rpx"></view>
</view>
</template>
<script>
import { shareUserInfo, shareUserInfoStats, editLevel, levelRatioList } from '@/api/user.js';
export default {
data() {
const currentDate = this.getDate({
format: true
});
return {
show: false,
screen: {
showcalendar: false
},
shopinfo: {
nickname: '',
username: '',
money: '',
mobile: '',
vip: '',
device_num: '',
id: ''
},
team_device_num: 0,
chartData: {},
opts: {
padding: [15, 10, 0, 15],
enableScroll: false,
legend: {},
xAxis: {
disableGrid: true,
showTitle: false
},
yAxis: {
disabled: true,
gridType: 'dash',
dashLength: 2
},
extra: {
line: {
type: 'curve',
width: 2,
activeType: 'none'
}
}
},
search: {
uid: '',
start_time: '',
end_time: '',
weekType: 1
},
dateTime: currentDate,
single: '',
team: {},
columns: []
};
},
onLoad(option) {
console.log(option.id, 'option.id');
if (option && option.id) {
this.search.uid = option.id;
}
levelRatioList().then((res) => {
console.log(res.data);
this.columns = [res.data];
});
},
onReady() {
this.getServerData();
},
async onPullDownRefresh() {
this.search.weekType = 1;
this.getServerData();
uni.stopPullDownRefresh();
},
methods: {
confirm(e) {
editLevel({
uid: this.search.uid,
levelRatio: e.value[0].level
}).then((res) => {
this.show = false
shareUserInfo({ uid: this.search.uid }).then((res) => {
uni.showToast({
title:'修改成功',
icon:"none"
})
this.shopinfo = res.data;
});
});
},
getDate(type) {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
if (type === 'start') {
year = year - 60;
} else if (type === 'end') {
year = year + 2;
}
month = month > 9 ? month : '0' + month;
day = day > 9 ? day : '0' + day;
return `${year}-${month}`;
},
bindDateChange(e) {
this.dateTime = e.detail.value;
},
getDateRanges() {
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth(); // 月份从 0 开始,所以当前月份是 month + 1
// 定义日期范围
const ranges = {
firstRange: {
name: '1号-10号',
start: new Date(year, month, 1), // 1号
end: new Date(year, month, 10) // 10号
},
secondRange: {
name: '11号-20号',
start: new Date(year, month, 11), // 11号
end: new Date(year, month, 20) // 20号
},
thirdRange: {
name: '21号-月底',
start: new Date(year, month, 21) // 21号
}
};
// 计算当前月份的最后一天
const lastDayOfMonth = new Date(year, month + 1, 0);
ranges.thirdRange.end = lastDayOfMonth; // 月底
// 格式化日期为 yyyy-mm-dd
function formatDate(date) {
const yyyy = date.getFullYear();
const mm = String(date.getMonth() + 1).padStart(2, '0'); // 月份从 1 开始
const dd = String(date.getDate()).padStart(2, '0');
return `${yyyy}-${mm}-${dd}`;
}
return [
{
name: ranges.firstRange.name,
start: formatDate(ranges.firstRange.start),
end: formatDate(ranges.firstRange.end)
},
{
name: ranges.secondRange.name,
start: formatDate(ranges.secondRange.start),
end: formatDate(ranges.secondRange.end)
},
{
name: ranges.thirdRange.name,
start: formatDate(ranges.thirdRange.start),
end: formatDate(ranges.thirdRange.end)
}
];
},
checkTime(e) {
this.search.startTime = e.start;
this.search.endTime = e.end;
this.screen.showcalendar = false;
this.search.weekType = '';
this.getServerData();
},
checkweek(week) {
this.search.weekType = week;
this.search.startTime = '';
this.search.endTime = '';
this.getServerData();
},
maskClick(e) {
this.search.startTime = e[0];
this.search.endTime = e[e.length - 1];
this.search.weekType = '';
this.getServerData();
},
getServerData() {
shareUserInfo({ uid: this.search.uid }).then((res) => {
this.shopinfo = res.data;
});
shareUserInfoStats(this.search).then((res) => {
this.team = res.data;
let _list = [
{
name: '订单数量',
data: res.data.stats7.map((item) => {
return item.num;
})
},
{
name: '订单金额',
data: res.data.stats7.map((item) => {
return item.payPrice;
})
},
];
this.chartData.categories = res.data.dayStr;
this.chartData.series = _list;
// this.chartData.console.log(res);
});
}
}
};
</script>
<style lang="scss">
.xkl_cur {
border: 1px solid #f33c2b;
color: #f33c2b;
}
.xkl_no {
border: 1px solid #999999;
color: #999999;
}
</style>

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

@@ -0,0 +1,365 @@
<template>
<view class="page">
<view class="system-height" :style="{height:statusBarHeight}"></view>
<!-- #ifdef MP -->
<view class="title-bar" style="height: 43px;">
<view class="icon" @click="back" v-if="!isHome">
<image src="../static/left.png"></image>
</view>
<view class="icon" @click="home" v-else>
<image src="../static/home.png"></image>
</view>
账户登录
</view>
<!-- #endif -->
<view class="wechat_login">
<view class="img">
<image src="../static/wechat_login.png" mode="widthFix"></image>
</view>
<view class="btn-wrapper">
<!-- #ifdef H5 -->
<button hover-class="none" @click="wechatLogin" class="bg-green btn1">微信登录</button>
<!-- #endif -->
<!-- #ifdef MP -->
<button hover-class="none" @tap="getUserProfile" class="bg-green btn1">微信登录</button>
<!-- #endif -->
<!-- <button hover-class="none" @click="isUp = true" class="btn2">手机号登录</button> -->
</view>
</view>
<block v-if="isUp">
<mobileLogin :isUp="isUp" @close="maskClose" :authKey="authKey" @wechatPhone="wechatPhone"></mobileLogin>
</block>
<block v-if="isPhoneBox">
<routinePhone :logoUrl="logoUrl" :isPhoneBox="isPhoneBox" @close="bindPhoneClose" :authKey="authKey">
</routinePhone>
</block>
</view>
</template>
<script>
const app = getApp();
let statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
import mobileLogin from '@/components/login_mobile/index.vue'
import routinePhone from '@/components/login_mobile/routine_phone.vue'
import {
mapGetters
} from "vuex";
import {
getLogo,
getUserPhone
} from '@/api/public';
import {
LOGO_URL,
EXPIRES_TIME,
USER_INFO,
STATE_R_KEY
} from '@/config/cache';
import {
getUserInfo
} from '@/api/user.js'
import Routine from '@/libs/routine';
export default {
data() {
return {
isUp: false,
phone: '',
statusBarHeight: statusBarHeight,
isHome: false,
isPhoneBox: false,
logoUrl: '',
code: '',
authKey: '',
options: '',
userInfo: {},
codeNum: 0
}
},
components: {
mobileLogin,
routinePhone
},
onLoad(options) {
getLogo().then(res => {
this.logoUrl = res.data.logoUrl
})
let that = this
let pages = getCurrentPages();
},
methods: {
back() {
uni.navigateBack();
},
home() {
uni.switchTab({
url: '/pages/index/index'
})
},
// 弹窗关闭
maskClose() {
this.isUp = false
},
bindPhoneClose(data) {
if (data.isStatus) {
this.isPhoneBox = false
this.$util.Tips({
title: '登录成功',
icon: 'success'
}, {
tab: 3
})
} else {
this.isPhoneBox = false
}
},
// #ifdef MP
// 小程序获取手机号码
getphonenumber(e) {
uni.showLoading({
title: '正在登录中'
});
Routine.getCode()
.then(code => {
this.getUserPhoneNumber(e.detail.encryptedData, e.detail.iv, code);
})
.catch(error => {
uni.$emit('closePage', false)
uni.hideLoading();
});
},
// 小程序获取手机号码回调
getUserPhoneNumber(encryptedData, iv, code) {
getUserPhone({
encryptedData: encryptedData,
iv: iv,
code: code,
type: 'routine',
key: this.authKey
})
.then(res => {
this.$store.commit('LOGIN', {
token: res.data.token
});
this.$store.commit("SETUID", res.data.uid);
this.getUserInfo();
this.$util.Tips({
title: '登录成功',
icon: 'success'
}, {
tab: 3
})
})
.catch(res => {
uni.hideLoading();
that.$util.Tips({
title: res
});
});
},
/**
* 获取个人用户信息
*/
getUserInfo: function() {
let that = this;
getUserInfo().then(res => {
uni.hideLoading();
that.userInfo = res.data
that.$store.commit("UPDATE_USERINFO", res.data);
that.$util.Tips({
title: '登录成功',
icon: 'success'
}, {
tab: 3
})
});
},
getUserProfile() {
let self = this;
uni.showLoading({
title: '正在登录中'
});
Routine.getUserProfile()
.then(res => {
Routine.getCode()
.then(code => {
self.getWxUser(code, res);
})
.catch(res => {
uni.hideLoading();
});
})
.catch(res => {
uni.hideLoading();
});
},
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
// 获取url后面的参数
getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var reg_rewrite = new RegExp("(^|/)" + name + "/([^/]*)(/|$)", "i");
var r = window.location.search.substr(1).match(reg);
var q = window.location.pathname.substr(1).match(reg_rewrite);
if (r != null) {
return unescape(r[2]);
} else if (q != null) {
return unescape(q[2]);
} else {
return null;
}
},
// 公众号登录
wechatLogin() {
if (!this.code && this.options.scope !== 'snsapi_base') {
this.$wechat.oAuth('snsapi_userinfo', '/pages/users/wechat_login/index');
} else {
// if (this.authKey) {
// this.isUp = true;
// }
this.isUp = true;
}
},
// 输入手机号后的回调
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()
}
}
// #endif
}
}
</script>
<style lang="scss">
page {
background: #fff;
height: 100%;
}
.page {
background: #fff;
height: 100%;
}
.wechat_login {
padding: 72rpx 34rpx;
.img image {
width: 100%;
}
.btn-wrapper {
margin-top: 86rpx;
padding: 0 66rpx;
button {
width: 100%;
height: 86rpx;
line-height: 86rpx;
margin-bottom: 40rpx;
border-radius: 120rpx;
font-size: 30rpx;
&.btn1 {
color: #fff;
}
&.btn2 {
color: #666666;
border: 1px solid #666666;
}
}
}
}
.title-bar {
position: relative;
display: flex;
align-items: center;
justify-content: center;
font-size: 36rpx;
}
.icon {
position: absolute;
left: 30rpx;
top: 0;
display: flex;
align-items: center;
justify-content: center;
width: 86rpx;
height: 86rpx;
image {
width: 50rpx;
height: 50rpx;
}
}
</style>