chore(样式调整): 所有页面统一使用<view :style="themeColor"> 这种方式
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="empty">
|
||||
<view class="empty" :style="themeColor">
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="{ backgroundColor: bgColor, minHeight: openBottomNav ? 'calc(100vh - 55px)' : '' }" class="page-img">
|
||||
<view :style="themeColor +';' + { backgroundColor: bgColor, minHeight: openBottomNav ? 'calc(100vh - 55px)' : '' }" class="page-img">
|
||||
<view class="site-info-box"
|
||||
v-if="$util.isWeiXin() && followOfficialAccount && followOfficialAccount.isShow && wechatQrcode">
|
||||
<view class="site-info">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<view class="container">
|
||||
<scroll-view class="scroll-view" :scroll-y="true" :show-scrollbar="false" :refresher-enabled="true" :refresher-triggered="refresherTriggered" @refresherrefresh="onRefresh">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<block v-if="diyData">
|
||||
<block v-for="(item, index) in diyData.value" :key="index">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<!-- #ifndef H5 -->
|
||||
<!-- <view class="page-header" v-if="goodsSkuDetail && goodsSkuDetail.config && goodsSkuDetail.config.nav_bar_switch == 0">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="content">
|
||||
<view class="content" :style="themeColor">
|
||||
<view class="head-wrap">
|
||||
<!-- 搜索区域 -->
|
||||
<view class="search-wrap uni-flex uni-row">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="detail-container" :class="{ 'safe-area': isIphoneX }">
|
||||
<view class="detail-container" :class="{ 'safe-area': isIphoneX }" :style="themeColor">
|
||||
<!-- 订单状态 -->
|
||||
<view class="status-wrap color-base-bg" :style="{ backgroundImage: 'url(' + $util.img('public/uniapp/order/status-wrap-bg.png') + ')' }">
|
||||
<view class="order-status-left">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="detail-container" :class="{ 'safe-area': isIphoneX }">
|
||||
<view class="detail-container" :class="{ 'safe-area': isIphoneX }" :style="themeColor">
|
||||
<!-- 订单状态 -->
|
||||
<view class="status-wrap color-base-bg" :style="{ backgroundImage: 'url(' + $util.img('public/uniapp/order/status-wrap-bg.png') + ')' }">
|
||||
<view class="order-status-left">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="order-container">
|
||||
<view class="order-container" :style="themeColor">
|
||||
<view class="cate-search">
|
||||
<view class="search-box">
|
||||
<input class="uni-input" maxlength="50" v-model="searchText" confirm-type="search"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<common-payment :api="api" create-data-key="orderCreateData" ref="payment"></common-payment>
|
||||
</view>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="apply">
|
||||
<view class="apply" :style="themeColor">
|
||||
<!-- 导航栏 -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="head-nav color-base-bg"></view>
|
||||
|
||||
@@ -1,147 +1,146 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="bill" >
|
||||
<mescroll-uni ref="mescroll" @getData="getData" class="member-point" :size="8">
|
||||
<block slot="list">
|
||||
<view class="balances" v-if="accountList.length" v-for="item in accountList" :key="item.id">
|
||||
<image v-if="item.type == 'order'" :src="$util.img('public/uniapp/fenxiao/bill/jiesuan.png')" mode="widthFix"></image>
|
||||
<image v-else :src="$util.img('public/uniapp/fenxiao/bill/withdraw.png')" mode="widthFix"></image>
|
||||
<view class="balances-info">
|
||||
<text>{{ item.type_name }}</text>
|
||||
<text>账单编号: {{ item.account_no }}</text>
|
||||
<text>{{ $util.timeStampTurnTime(item.create_time) }}</text>
|
||||
</view>
|
||||
<view class="balances-num">
|
||||
<text :class="item.money > 0 ? 'color-base-text' : ''">{{ item.money > 0 ? '+' + item.money : item.money }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<ns-empty v-if="!accountList.length && showEmpty" text="暂无账单信息" :isIndex="false"></ns-empty>
|
||||
</block>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</mescroll-uni>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
accountList: {},
|
||||
showEmpty: true
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
setTimeout( () => {
|
||||
if (!this.addonIsExist.fenxiao) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启分销',
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/index/index');
|
||||
}, 2000);
|
||||
}
|
||||
},1000);
|
||||
},
|
||||
methods: {
|
||||
getData(mescroll) {
|
||||
if (mescroll.num == 1) {
|
||||
this.accountList = [];
|
||||
}
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/account/page',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data && res.data.list) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.accountList = []; //如果是第一页需手动制空列表
|
||||
this.accountList = this.accountList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
this.showEmpty = true;
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/deep/ .empty {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
/deep/ .member-point .mescroll-uni-content {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.balances {
|
||||
width: calc(100% - 60rpx);
|
||||
border-radius: 10rpx;
|
||||
margin: 0 auto;
|
||||
padding: 27rpx 27rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
background: #fff;
|
||||
margin-bottom: 18rpx;
|
||||
margin-top: 18rpx;
|
||||
|
||||
image {
|
||||
width: 54rpx;
|
||||
height: 54rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.balances-info {
|
||||
flex: 1;
|
||||
margin-left: 16rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
text {
|
||||
line-height: 1;
|
||||
|
||||
&:last-child {
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
|
||||
&:nth-child(2) {
|
||||
margin-top: 18rpx;
|
||||
font-size: $font-size-tag;
|
||||
color: $color-tip;
|
||||
}
|
||||
|
||||
&:nth-child(3) {
|
||||
font-size: $font-size-tag;
|
||||
margin-top: 19rpx;
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.balances-num {
|
||||
text {
|
||||
line-height: 1;
|
||||
font-size: $font-size-toolbar;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="bill" :style="themeColor">
|
||||
<mescroll-uni ref="mescroll" @getData="getData" class="member-point" :size="8">
|
||||
<block slot="list">
|
||||
<view class="balances" v-if="accountList.length" v-for="item in accountList" :key="item.id">
|
||||
<image v-if="item.type == 'order'" :src="$util.img('public/uniapp/fenxiao/bill/jiesuan.png')" mode="widthFix"></image>
|
||||
<image v-else :src="$util.img('public/uniapp/fenxiao/bill/withdraw.png')" mode="widthFix"></image>
|
||||
<view class="balances-info">
|
||||
<text>{{ item.type_name }}</text>
|
||||
<text>账单编号: {{ item.account_no }}</text>
|
||||
<text>{{ $util.timeStampTurnTime(item.create_time) }}</text>
|
||||
</view>
|
||||
<view class="balances-num">
|
||||
<text :class="item.money > 0 ? 'color-base-text' : ''">{{ item.money > 0 ? '+' + item.money : item.money }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<ns-empty v-if="!accountList.length && showEmpty" text="暂无账单信息" :isIndex="false"></ns-empty>
|
||||
</block>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</mescroll-uni>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
accountList: {},
|
||||
showEmpty: true
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
setTimeout( () => {
|
||||
if (!this.addonIsExist.fenxiao) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启分销',
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/index/index');
|
||||
}, 2000);
|
||||
}
|
||||
},1000);
|
||||
},
|
||||
methods: {
|
||||
getData(mescroll) {
|
||||
if (mescroll.num == 1) {
|
||||
this.accountList = [];
|
||||
}
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/account/page',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data && res.data.list) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.accountList = []; //如果是第一页需手动制空列表
|
||||
this.accountList = this.accountList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
this.showEmpty = true;
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/deep/ .empty {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
/deep/ .member-point .mescroll-uni-content {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.balances {
|
||||
width: calc(100% - 60rpx);
|
||||
border-radius: 10rpx;
|
||||
margin: 0 auto;
|
||||
padding: 27rpx 27rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
background: #fff;
|
||||
margin-bottom: 18rpx;
|
||||
margin-top: 18rpx;
|
||||
|
||||
image {
|
||||
width: 54rpx;
|
||||
height: 54rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.balances-info {
|
||||
flex: 1;
|
||||
margin-left: 16rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
text {
|
||||
line-height: 1;
|
||||
|
||||
&:last-child {
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
|
||||
&:nth-child(2) {
|
||||
margin-top: 18rpx;
|
||||
font-size: $font-size-tag;
|
||||
color: $color-tip;
|
||||
}
|
||||
|
||||
&:nth-child(3) {
|
||||
font-size: $font-size-tag;
|
||||
margin-top: 19rpx;
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.balances-num {
|
||||
text {
|
||||
line-height: 1;
|
||||
font-size: $font-size-toolbar;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni ref="mescroll" @getData="getData" top="0" class="member-point" :size="8" v-if="storeToken">
|
||||
<block slot="list">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="content">
|
||||
<view class="content" :style="themeColor">
|
||||
<mescroll-uni ref="mescroll" @getData="getGoodsList">
|
||||
<block slot="list">
|
||||
<view class="goods-list" :style="{ backgroundImage: 'url(' + $util.img('public/uniapp/fenxiao/promote/promote_bg.png') + ')' }">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,320 +1,319 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="container">
|
||||
<view class="level-top">
|
||||
<image :src="$util.img('public/uniapp/level/level-top-bg.png')"></image>
|
||||
</view>
|
||||
|
||||
<swiper :autoplay="false" :duration="500" class="level-swiper" previous-margin="50rpx" next-margin="50rpx" @change="swiperChange" :current="curr">
|
||||
<swiper-item v-for="(item, index) in levelList" :key="index">
|
||||
<view class="level-item" :class="{'curr': index == curr}">
|
||||
<view class="level-wrap">
|
||||
<view class="member-info">
|
||||
<view class="head-img">
|
||||
<image :src="fenxiaoInfo.headimg ? $util.img(fenxiaoInfo.headimg) : $util.getDefaultImage().head" @error="fenxiaoInfo.headimg = $util.getDefaultImage().head" mode="aspectFill"/>
|
||||
</view>
|
||||
<view class="nickname">{{ fenxiaoInfo.nickname }}</view>
|
||||
<view class="level-name">{{ item.level_name }}</view>
|
||||
</view>
|
||||
<view class="level-rate">
|
||||
<view class="rate-item" v-if="config.level > 0">
|
||||
<view class="title">一级分佣比率</view>
|
||||
<view class="rate">{{ item.one_rate }}<text class="percentage">%</text></view>
|
||||
</view>
|
||||
<view class="rate-item" v-if="config.level > 1">
|
||||
<view class="title">二级分佣比率</view>
|
||||
<view class="rate">{{ item.two_rate }}<text class="percentage">%</text></view>
|
||||
</view>
|
||||
<view class="rate-item" v-if="config.level > 2">
|
||||
<view class="title">三级分佣比率</view>
|
||||
<view class="rate">{{ item.three_rate }}<text class="percentage">%</text></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="not-unlocked" v-if="item.level_num > fenxiaoInfo.level_num">
|
||||
<text class="iconfont icon-suoding"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
<view class="level-condition" v-if="levelInfo">
|
||||
<view class="condition-title">
|
||||
<view class="title">快速升级技巧</view>
|
||||
<view class="rate price-font">
|
||||
<text class="complete">{{ levelInfo.complete > levelInfo.task_num ? levelInfo.task_num : levelInfo.complete }}</text>
|
||||
<text class="num">/{{ levelInfo.task_num }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="task">
|
||||
<view class="task-item" v-for="(item, index) in levelInfo.task" :key="index">
|
||||
<view class="flex-box">
|
||||
<view class="title">
|
||||
{{item.title}}
|
||||
<text class="iconfont icon-wenxiao" @click="openTips(item)"></text>
|
||||
</view>
|
||||
<view class="status" :class="{'complete': item.progress == 100}">
|
||||
{{ item.progress == 100 ? '已完成' : '未完成' }}</view>
|
||||
</view>
|
||||
<view class="progress">
|
||||
<progress :percent="item.progress" activeColor="#E7B667" stroke-width="4" />
|
||||
</view>
|
||||
<view class="flex-box">
|
||||
<view class="desc">{{item.desc}}</view>
|
||||
<view class="rate price-font">
|
||||
<text class="complete">{{ item.value }}</text>
|
||||
<text class="num">/{{ item.condition }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<uni-popup type="bottom" ref="tips">
|
||||
<view class="popup">
|
||||
<view class="popup-header">
|
||||
<text class="tit">提示</text>
|
||||
<text class="iconfont icon-close" @click="$refs.tips.close()"></text>
|
||||
</view>
|
||||
<view class="popup-body">
|
||||
<view>{{ tips }}</view>
|
||||
<view v-if="levelInfo">{{ levelInfo.upgrade_type == 1 ? '满足任意一条件即可升级' : '满足全部条件才能进行升级' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<ns-goods-recommend route="fenxiao_level"></ns-goods-recommend>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import fenxiaoWords from 'common/js/fenxiao-words.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
fenxiaoInfo: {
|
||||
condition: {
|
||||
last_level: null
|
||||
}
|
||||
},
|
||||
config: {},
|
||||
levelList: [],
|
||||
curr: 0,
|
||||
tips: ''
|
||||
};
|
||||
},
|
||||
mixins: [fenxiaoWords],
|
||||
computed: {
|
||||
levelInfo() {
|
||||
if (this.levelList.length) {
|
||||
let level = this.levelList[this.curr];
|
||||
level.task = [];
|
||||
level.complete = 0;
|
||||
|
||||
if (level.one_fenxiao_order_num > 0) {
|
||||
let task = {
|
||||
title: '下级消费',
|
||||
desc: '下级消费单数满' + level.one_fenxiao_order_num + '单',
|
||||
tips: '分销商自己购买和自己推荐的直属会员购买的订单次数达到'+ level.one_fenxiao_order_num + '单',
|
||||
condition: level.one_fenxiao_order_num,
|
||||
value: this.fenxiaoInfo.one_fenxiao_order_num,
|
||||
progress: parseFloat(this.fenxiaoInfo.one_fenxiao_order_num) > parseFloat(level.one_fenxiao_order_num) ? 100 : (parseFloat(this.fenxiaoInfo.one_fenxiao_order_num) / parseFloat(level.one_fenxiao_order_num) * 100).toFixed(2)
|
||||
}
|
||||
if (task.progress == 100) level.complete += 1;
|
||||
level.task.push(task);
|
||||
}
|
||||
if (level.one_fenxiao_total_order > 0) {
|
||||
let task = {
|
||||
title: '下级消费',
|
||||
desc: '下级消费金额满' + this.moneyFormat(level.one_fenxiao_total_order) + '元',
|
||||
tips: '分销商自己购买和推荐的直属会员购买的订单的总额达到'+ this.moneyFormat(level.one_fenxiao_total_order) + '元',
|
||||
condition: this.moneyFormat(level.one_fenxiao_total_order),
|
||||
value: this.fenxiaoInfo.one_fenxiao_total_order,
|
||||
progress: parseFloat(this.fenxiaoInfo.one_fenxiao_total_order) > parseFloat(level.one_fenxiao_total_order) ? 100 : (parseFloat(this.fenxiaoInfo.one_fenxiao_total_order) / parseFloat(level.one_fenxiao_total_order) * 100)
|
||||
.toFixed(2)
|
||||
}
|
||||
if (task.progress == 100) level.complete += 1;
|
||||
level.task.push(task);
|
||||
}
|
||||
if (level.one_fenxiao_order_money > 0) {
|
||||
let task = {
|
||||
title: '下级消费',
|
||||
desc: '下级消费产生佣金总额满' + this.moneyFormat(level.one_fenxiao_order_money) + '元',
|
||||
tips: '分销商自己购买和自己推荐的直属会员购买的订单佣金总额达到'+ this.moneyFormat(level.one_fenxiao_order_money) + '元',
|
||||
condition: this.moneyFormat(level.one_fenxiao_order_money),
|
||||
value: this.fenxiaoInfo.one_fenxiao_order_money,
|
||||
progress: parseFloat(this.fenxiaoInfo.one_fenxiao_order_money) > parseFloat(level.one_fenxiao_order_money) ? 100 : (parseFloat(this.fenxiaoInfo.one_fenxiao_order_money) / parseFloat(level.one_fenxiao_order_money) * 100)
|
||||
.toFixed(2)
|
||||
}
|
||||
if (task.progress == 100) level.complete += 1;
|
||||
level.task.push(task);
|
||||
}
|
||||
if (level.order_num > 0) {
|
||||
let task = {
|
||||
title: '自身消费',
|
||||
desc: '自身消费单数满' + level.order_num + '单',
|
||||
tips: '分销商自己购买的订单次数达到'+ level.order_num + '单',
|
||||
condition: level.order_num,
|
||||
value: this.fenxiaoInfo.order_num,
|
||||
progress: parseFloat(this.fenxiaoInfo.order_num) > parseFloat(level.order_num) ? 100 : (parseFloat(this.fenxiaoInfo.order_num) / parseFloat(level.order_num) * 100).toFixed(2)
|
||||
}
|
||||
if (task.progress == 100) level.complete += 1;
|
||||
level.task.push(task);
|
||||
}
|
||||
if (level.order_money > 0) {
|
||||
let task = {
|
||||
title: '自身消费',
|
||||
desc: '自身消费金额满' + this.moneyFormat(level.order_money) + '元',
|
||||
tips: '分销商自己购买的订单总额满足'+ this.moneyFormat(level.order_money) + '元',
|
||||
condition: this.moneyFormat(level.order_money),
|
||||
value: this.fenxiaoInfo.order_money,
|
||||
progress: parseFloat(this.fenxiaoInfo.order_money) > parseFloat(level.order_money) ? 100 : (parseFloat(this.fenxiaoInfo.order_money) / parseFloat(level.order_money) * 100).toFixed(2)
|
||||
}
|
||||
if (task.progress == 100) level.complete += 1;
|
||||
level.task.push(task);
|
||||
}
|
||||
if (level.one_child_num > 0) {
|
||||
let task = {
|
||||
title: '邀请好友',
|
||||
desc: '邀请好友人数达到' + level.one_child_num + '人',
|
||||
tips: '分销商的直属下级会员人数达到'+level.one_child_num+'人(包含已经申请成为分销商的)',
|
||||
condition: level.one_child_num,
|
||||
value: this.fenxiaoInfo.one_child_num,
|
||||
progress: parseFloat(this.fenxiaoInfo.one_child_num) > parseFloat(level.one_child_num) ? 100 : (parseFloat(this.fenxiaoInfo.one_child_num) / parseFloat(level.one_child_num) * 100).toFixed(2)
|
||||
}
|
||||
if (task.progress == 100) level.complete += 1;
|
||||
level.task.push(task);
|
||||
}
|
||||
if (level.one_child_fenxiao_num > 0) {
|
||||
let task = {
|
||||
title: '邀请好友',
|
||||
desc: '邀请好友成为分销商人数达到' + level.one_child_fenxiao_num + '人',
|
||||
tips: '分销商的直属下级分销商人数达到'+ level.one_child_fenxiao_num + '人',
|
||||
condition: level.one_child_fenxiao_num,
|
||||
value: this.fenxiaoInfo.one_child_fenxiao_num,
|
||||
progress: parseFloat(this.fenxiaoInfo.one_child_fenxiao_num) > parseFloat(level.one_child_fenxiao_num) ? 100 : (parseFloat(this.fenxiaoInfo.one_child_fenxiao_num) / parseFloat(level.one_child_fenxiao_num) * 100).toFixed(2)
|
||||
}
|
||||
if (task.progress == 100) level.complete += 1;
|
||||
level.task.push(task);
|
||||
}
|
||||
level.task_num = level.upgrade_type == 1 ? 1 : level.task.length;
|
||||
return level;
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {},
|
||||
onShow() {
|
||||
setTimeout( () => {
|
||||
if (!this.addonIsExist.fenxiao) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启分销',
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/index/index');
|
||||
}, 2000);
|
||||
}
|
||||
},1000);
|
||||
|
||||
if (this.fenxiaoWords && this.fenxiaoWords.fenxiao_name) this.$langConfig.title(this.fenxiaoWords.fenxiao_name + '等级');
|
||||
|
||||
if (this.storeToken) {
|
||||
this.getFenxiaoInfo();
|
||||
this.getBasicsConfig();
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/login/login', {
|
||||
back: '/pages_promotion/fenxiao/level'
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取分销等级信息
|
||||
*/
|
||||
getFenxiaoLevel() {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/Level/lists',
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.levelList = res.data;
|
||||
this.levelList.forEach((item, index) => {
|
||||
if (item.level_id == this.fenxiaoInfo.level_id) this.curr = index;
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取分销商信息
|
||||
*/
|
||||
getFenxiaoInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/detail',
|
||||
success: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.fenxiaoInfo = res.data;
|
||||
this.curr = this.fenxiaoInfo.level_num;
|
||||
this.getFenxiaoLevel();
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_promotion/fenxiao/apply');
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取分销基本配置
|
||||
*/
|
||||
getBasicsConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/config/basics',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.config = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
swiperChange(e) {
|
||||
this.curr = e.detail.current;
|
||||
},
|
||||
moneyFormat(money) {
|
||||
if (isNaN(parseFloat(money))) return money;
|
||||
return parseFloat(money).toFixed(2);
|
||||
},
|
||||
openTips(data) {
|
||||
this.tips = data.tips;
|
||||
this.$refs.tips.open();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/level.scss';
|
||||
</style>
|
||||
<style scoped lang="scss">
|
||||
/deep/ .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
background: none;
|
||||
max-height: unset !important;
|
||||
overflow-y: hidden !important;
|
||||
}
|
||||
|
||||
/deep/ .uni-popup__wrapper {
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
}
|
||||
|
||||
/deep/ .uni-popup {
|
||||
z-index: 8;
|
||||
}
|
||||
|
||||
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
max-height: unset !important;
|
||||
}
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="level-top">
|
||||
<image :src="$util.img('public/uniapp/level/level-top-bg.png')"></image>
|
||||
</view>
|
||||
|
||||
<swiper :autoplay="false" :duration="500" class="level-swiper" previous-margin="50rpx" next-margin="50rpx" @change="swiperChange" :current="curr">
|
||||
<swiper-item v-for="(item, index) in levelList" :key="index">
|
||||
<view class="level-item" :class="{'curr': index == curr}">
|
||||
<view class="level-wrap">
|
||||
<view class="member-info">
|
||||
<view class="head-img">
|
||||
<image :src="fenxiaoInfo.headimg ? $util.img(fenxiaoInfo.headimg) : $util.getDefaultImage().head" @error="fenxiaoInfo.headimg = $util.getDefaultImage().head" mode="aspectFill"/>
|
||||
</view>
|
||||
<view class="nickname">{{ fenxiaoInfo.nickname }}</view>
|
||||
<view class="level-name">{{ item.level_name }}</view>
|
||||
</view>
|
||||
<view class="level-rate">
|
||||
<view class="rate-item" v-if="config.level > 0">
|
||||
<view class="title">一级分佣比率</view>
|
||||
<view class="rate">{{ item.one_rate }}<text class="percentage">%</text></view>
|
||||
</view>
|
||||
<view class="rate-item" v-if="config.level > 1">
|
||||
<view class="title">二级分佣比率</view>
|
||||
<view class="rate">{{ item.two_rate }}<text class="percentage">%</text></view>
|
||||
</view>
|
||||
<view class="rate-item" v-if="config.level > 2">
|
||||
<view class="title">三级分佣比率</view>
|
||||
<view class="rate">{{ item.three_rate }}<text class="percentage">%</text></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="not-unlocked" v-if="item.level_num > fenxiaoInfo.level_num">
|
||||
<text class="iconfont icon-suoding"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
<view class="level-condition" v-if="levelInfo">
|
||||
<view class="condition-title">
|
||||
<view class="title">快速升级技巧</view>
|
||||
<view class="rate price-font">
|
||||
<text class="complete">{{ levelInfo.complete > levelInfo.task_num ? levelInfo.task_num : levelInfo.complete }}</text>
|
||||
<text class="num">/{{ levelInfo.task_num }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="task">
|
||||
<view class="task-item" v-for="(item, index) in levelInfo.task" :key="index">
|
||||
<view class="flex-box">
|
||||
<view class="title">
|
||||
{{item.title}}
|
||||
<text class="iconfont icon-wenxiao" @click="openTips(item)"></text>
|
||||
</view>
|
||||
<view class="status" :class="{'complete': item.progress == 100}">
|
||||
{{ item.progress == 100 ? '已完成' : '未完成' }}</view>
|
||||
</view>
|
||||
<view class="progress">
|
||||
<progress :percent="item.progress" activeColor="#E7B667" stroke-width="4" />
|
||||
</view>
|
||||
<view class="flex-box">
|
||||
<view class="desc">{{item.desc}}</view>
|
||||
<view class="rate price-font">
|
||||
<text class="complete">{{ item.value }}</text>
|
||||
<text class="num">/{{ item.condition }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<uni-popup type="bottom" ref="tips">
|
||||
<view class="popup">
|
||||
<view class="popup-header">
|
||||
<text class="tit">提示</text>
|
||||
<text class="iconfont icon-close" @click="$refs.tips.close()"></text>
|
||||
</view>
|
||||
<view class="popup-body">
|
||||
<view>{{ tips }}</view>
|
||||
<view v-if="levelInfo">{{ levelInfo.upgrade_type == 1 ? '满足任意一条件即可升级' : '满足全部条件才能进行升级' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<ns-goods-recommend route="fenxiao_level"></ns-goods-recommend>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import fenxiaoWords from 'common/js/fenxiao-words.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
fenxiaoInfo: {
|
||||
condition: {
|
||||
last_level: null
|
||||
}
|
||||
},
|
||||
config: {},
|
||||
levelList: [],
|
||||
curr: 0,
|
||||
tips: ''
|
||||
};
|
||||
},
|
||||
mixins: [fenxiaoWords],
|
||||
computed: {
|
||||
levelInfo() {
|
||||
if (this.levelList.length) {
|
||||
let level = this.levelList[this.curr];
|
||||
level.task = [];
|
||||
level.complete = 0;
|
||||
|
||||
if (level.one_fenxiao_order_num > 0) {
|
||||
let task = {
|
||||
title: '下级消费',
|
||||
desc: '下级消费单数满' + level.one_fenxiao_order_num + '单',
|
||||
tips: '分销商自己购买和自己推荐的直属会员购买的订单次数达到'+ level.one_fenxiao_order_num + '单',
|
||||
condition: level.one_fenxiao_order_num,
|
||||
value: this.fenxiaoInfo.one_fenxiao_order_num,
|
||||
progress: parseFloat(this.fenxiaoInfo.one_fenxiao_order_num) > parseFloat(level.one_fenxiao_order_num) ? 100 : (parseFloat(this.fenxiaoInfo.one_fenxiao_order_num) / parseFloat(level.one_fenxiao_order_num) * 100).toFixed(2)
|
||||
}
|
||||
if (task.progress == 100) level.complete += 1;
|
||||
level.task.push(task);
|
||||
}
|
||||
if (level.one_fenxiao_total_order > 0) {
|
||||
let task = {
|
||||
title: '下级消费',
|
||||
desc: '下级消费金额满' + this.moneyFormat(level.one_fenxiao_total_order) + '元',
|
||||
tips: '分销商自己购买和推荐的直属会员购买的订单的总额达到'+ this.moneyFormat(level.one_fenxiao_total_order) + '元',
|
||||
condition: this.moneyFormat(level.one_fenxiao_total_order),
|
||||
value: this.fenxiaoInfo.one_fenxiao_total_order,
|
||||
progress: parseFloat(this.fenxiaoInfo.one_fenxiao_total_order) > parseFloat(level.one_fenxiao_total_order) ? 100 : (parseFloat(this.fenxiaoInfo.one_fenxiao_total_order) / parseFloat(level.one_fenxiao_total_order) * 100)
|
||||
.toFixed(2)
|
||||
}
|
||||
if (task.progress == 100) level.complete += 1;
|
||||
level.task.push(task);
|
||||
}
|
||||
if (level.one_fenxiao_order_money > 0) {
|
||||
let task = {
|
||||
title: '下级消费',
|
||||
desc: '下级消费产生佣金总额满' + this.moneyFormat(level.one_fenxiao_order_money) + '元',
|
||||
tips: '分销商自己购买和自己推荐的直属会员购买的订单佣金总额达到'+ this.moneyFormat(level.one_fenxiao_order_money) + '元',
|
||||
condition: this.moneyFormat(level.one_fenxiao_order_money),
|
||||
value: this.fenxiaoInfo.one_fenxiao_order_money,
|
||||
progress: parseFloat(this.fenxiaoInfo.one_fenxiao_order_money) > parseFloat(level.one_fenxiao_order_money) ? 100 : (parseFloat(this.fenxiaoInfo.one_fenxiao_order_money) / parseFloat(level.one_fenxiao_order_money) * 100)
|
||||
.toFixed(2)
|
||||
}
|
||||
if (task.progress == 100) level.complete += 1;
|
||||
level.task.push(task);
|
||||
}
|
||||
if (level.order_num > 0) {
|
||||
let task = {
|
||||
title: '自身消费',
|
||||
desc: '自身消费单数满' + level.order_num + '单',
|
||||
tips: '分销商自己购买的订单次数达到'+ level.order_num + '单',
|
||||
condition: level.order_num,
|
||||
value: this.fenxiaoInfo.order_num,
|
||||
progress: parseFloat(this.fenxiaoInfo.order_num) > parseFloat(level.order_num) ? 100 : (parseFloat(this.fenxiaoInfo.order_num) / parseFloat(level.order_num) * 100).toFixed(2)
|
||||
}
|
||||
if (task.progress == 100) level.complete += 1;
|
||||
level.task.push(task);
|
||||
}
|
||||
if (level.order_money > 0) {
|
||||
let task = {
|
||||
title: '自身消费',
|
||||
desc: '自身消费金额满' + this.moneyFormat(level.order_money) + '元',
|
||||
tips: '分销商自己购买的订单总额满足'+ this.moneyFormat(level.order_money) + '元',
|
||||
condition: this.moneyFormat(level.order_money),
|
||||
value: this.fenxiaoInfo.order_money,
|
||||
progress: parseFloat(this.fenxiaoInfo.order_money) > parseFloat(level.order_money) ? 100 : (parseFloat(this.fenxiaoInfo.order_money) / parseFloat(level.order_money) * 100).toFixed(2)
|
||||
}
|
||||
if (task.progress == 100) level.complete += 1;
|
||||
level.task.push(task);
|
||||
}
|
||||
if (level.one_child_num > 0) {
|
||||
let task = {
|
||||
title: '邀请好友',
|
||||
desc: '邀请好友人数达到' + level.one_child_num + '人',
|
||||
tips: '分销商的直属下级会员人数达到'+level.one_child_num+'人(包含已经申请成为分销商的)',
|
||||
condition: level.one_child_num,
|
||||
value: this.fenxiaoInfo.one_child_num,
|
||||
progress: parseFloat(this.fenxiaoInfo.one_child_num) > parseFloat(level.one_child_num) ? 100 : (parseFloat(this.fenxiaoInfo.one_child_num) / parseFloat(level.one_child_num) * 100).toFixed(2)
|
||||
}
|
||||
if (task.progress == 100) level.complete += 1;
|
||||
level.task.push(task);
|
||||
}
|
||||
if (level.one_child_fenxiao_num > 0) {
|
||||
let task = {
|
||||
title: '邀请好友',
|
||||
desc: '邀请好友成为分销商人数达到' + level.one_child_fenxiao_num + '人',
|
||||
tips: '分销商的直属下级分销商人数达到'+ level.one_child_fenxiao_num + '人',
|
||||
condition: level.one_child_fenxiao_num,
|
||||
value: this.fenxiaoInfo.one_child_fenxiao_num,
|
||||
progress: parseFloat(this.fenxiaoInfo.one_child_fenxiao_num) > parseFloat(level.one_child_fenxiao_num) ? 100 : (parseFloat(this.fenxiaoInfo.one_child_fenxiao_num) / parseFloat(level.one_child_fenxiao_num) * 100).toFixed(2)
|
||||
}
|
||||
if (task.progress == 100) level.complete += 1;
|
||||
level.task.push(task);
|
||||
}
|
||||
level.task_num = level.upgrade_type == 1 ? 1 : level.task.length;
|
||||
return level;
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {},
|
||||
onShow() {
|
||||
setTimeout( () => {
|
||||
if (!this.addonIsExist.fenxiao) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启分销',
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/index/index');
|
||||
}, 2000);
|
||||
}
|
||||
},1000);
|
||||
|
||||
if (this.fenxiaoWords && this.fenxiaoWords.fenxiao_name) this.$langConfig.title(this.fenxiaoWords.fenxiao_name + '等级');
|
||||
|
||||
if (this.storeToken) {
|
||||
this.getFenxiaoInfo();
|
||||
this.getBasicsConfig();
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/login/login', {
|
||||
back: '/pages_promotion/fenxiao/level'
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取分销等级信息
|
||||
*/
|
||||
getFenxiaoLevel() {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/Level/lists',
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.levelList = res.data;
|
||||
this.levelList.forEach((item, index) => {
|
||||
if (item.level_id == this.fenxiaoInfo.level_id) this.curr = index;
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取分销商信息
|
||||
*/
|
||||
getFenxiaoInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/detail',
|
||||
success: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.fenxiaoInfo = res.data;
|
||||
this.curr = this.fenxiaoInfo.level_num;
|
||||
this.getFenxiaoLevel();
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_promotion/fenxiao/apply');
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取分销基本配置
|
||||
*/
|
||||
getBasicsConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/config/basics',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.config = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
swiperChange(e) {
|
||||
this.curr = e.detail.current;
|
||||
},
|
||||
moneyFormat(money) {
|
||||
if (isNaN(parseFloat(money))) return money;
|
||||
return parseFloat(money).toFixed(2);
|
||||
},
|
||||
openTips(data) {
|
||||
this.tips = data.tips;
|
||||
this.$refs.tips.open();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/level.scss';
|
||||
</style>
|
||||
<style scoped lang="scss">
|
||||
/deep/ .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
background: none;
|
||||
max-height: unset !important;
|
||||
overflow-y: hidden !important;
|
||||
}
|
||||
|
||||
/deep/ .uni-popup__wrapper {
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
}
|
||||
|
||||
/deep/ .uni-popup {
|
||||
z-index: 8;
|
||||
}
|
||||
|
||||
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
max-height: unset !important;
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<view class="withdraw-cate">
|
||||
<block v-for="(item, index) in category" :key="index">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<view class="order-detail">
|
||||
<view class="order-detail-box">
|
||||
|
||||
@@ -1,363 +1,362 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="fenxiao-promote" :style="{ backgroundImage: 'url(' + $util.img('public/uniapp/fenxiao/promote/promote_bg.png') + ')' }">
|
||||
<view class="my-earnings">
|
||||
<view class="earnings-head-wrap">
|
||||
<view class="earnings-head">
|
||||
<image class="name" :src="$util.img('public/uniapp/fenxiao/promote/my_earnings.png')" mode="aspectFit"></image>
|
||||
<image class="money-bg" :src="$util.img('public/uniapp/fenxiao/promote/money.png')" mode="aspectFill"></image>
|
||||
<view class="content">
|
||||
累计收益
|
||||
<text class="money-text">{{ detailData.total_commission }}</text>
|
||||
元
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="earnings-body">
|
||||
<view class="earnings-tab">
|
||||
<text :class="{ active: tabIndex == 0 }" @click="tabCut(0)">已邀请好友</text>
|
||||
<text :class="{ active: tabIndex == 1 }" @click="tabCut(1)">已下单好友</text>
|
||||
</view>
|
||||
<scroll-view scroll-y="true" class="earnings-content-wrap" @scrolltolower="getTeam()">
|
||||
<view class="earnings-list" v-if="promote.list.length">
|
||||
<view class="earnings-item" v-for="(item, index) in promote.list" :key="index">
|
||||
<image
|
||||
class="item-img"
|
||||
:src="item.headimg ? $util.img(item.headimg) : $util.getDefaultImage().head"
|
||||
@error="item.headimg = $util.getDefaultImage().head"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
<view class="item-content">
|
||||
<view class="item-name multi-hidden">{{ item.nickname }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="earnings-empty" v-else>暂无已邀请好友,快去邀请吧</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="activity-rules">
|
||||
<image class="rules-name" :src="$util.img('public/uniapp/fenxiao/promote/activity_rules.png')" mode="aspectFit"></image>
|
||||
<view class="content" v-if="promoteContent.content"><rich-text :nodes="promoteContent.content"></rich-text></view>
|
||||
<view class="rules-empty" v-else>暂无活动规则</view>
|
||||
</view>
|
||||
<view class="active-btn"><button type="primary" @click="toPoster()">邀请好友</button></view>
|
||||
<ns-copyright></ns-copyright>
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<!-- 小程序隐私协议 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import htmlParser from '@/common/js/html-parser';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tabIndex: 0,
|
||||
promoteContent: {},
|
||||
promote: {
|
||||
page: 0,
|
||||
page_size: 5,
|
||||
page_count: 0,
|
||||
list: []
|
||||
},
|
||||
isPay: 0,
|
||||
detailData: {},
|
||||
templateId: '',
|
||||
poster:'',
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
setTimeout( () => {
|
||||
if (!this.addonIsExist.fenxiao) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启分销',
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/index/index');
|
||||
}, 2000);
|
||||
}
|
||||
},1000);
|
||||
|
||||
if (this.storeToken) {
|
||||
this.getTeam();
|
||||
this.getPromoteRule();
|
||||
this.getFenxiaoDetail();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_promotion/fenxiao/promote_code');
|
||||
});
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getTemplateId();
|
||||
this.getPoster();
|
||||
},
|
||||
methods: {
|
||||
toPoster(){
|
||||
this.$util.redirectTo('/pages_promotion/fenxiao/promote_code', { poster: this.poster,templateId:this.templateId })
|
||||
},
|
||||
tabCut(index) {
|
||||
this.tabIndex = index;
|
||||
this.isPay = index;
|
||||
|
||||
this.promote.page_count = 0;
|
||||
this.promote.page = 0;
|
||||
this.promote.page_size = 5;
|
||||
this.getTeam();
|
||||
},
|
||||
getTeam() {
|
||||
if (this.promote.page_count > 0 && this.promote.page == this.promote.page_count) return;
|
||||
this.promote.page++;
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/team',
|
||||
data: {
|
||||
page: this.promote.page,
|
||||
page_size: this.promote.page_size,
|
||||
is_pay: this.isPay,
|
||||
level: 1
|
||||
},
|
||||
success: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
if (res.code >= 0) {
|
||||
if (this.promote.page == 1) this.promote.list = [];
|
||||
this.promote.page_count = res.data.page_count;
|
||||
this.promote.list = this.promote.list.concat(res.data.list);
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取分销商信息
|
||||
getFenxiaoDetail() {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/detail',
|
||||
success: res => {
|
||||
if (res.data) {
|
||||
this.detailData = res.data;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取富文本
|
||||
getPromoteRule() {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/config/promoterule',
|
||||
success: res => {
|
||||
if (res.data) {
|
||||
this.promoteContent = res.data;
|
||||
this.promoteContent.content = res.data.content ? htmlParser(res.data.content) : '';
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取分享海报
|
||||
*/
|
||||
getPoster() {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/posterList',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.poster = res.data.toString();
|
||||
this.poster = encodeURIComponent(this.poster);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取分享海报id
|
||||
*/
|
||||
getTemplateId() {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/posterTemplateIds',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.templateId = [...res.data].join();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.fenxiao-promote {
|
||||
overflow: hidden;
|
||||
padding: 0 30rpx 160rpx;
|
||||
min-height: 100vh;
|
||||
background-color: #ff2d46;
|
||||
background-size: 100%;
|
||||
background-repeat: no-repeat;
|
||||
.my-earnings,
|
||||
.activity-rules {
|
||||
background-color: #fff;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
.my-earnings {
|
||||
margin-top: 230rpx;
|
||||
padding-bottom: 40rpx;
|
||||
.earnings-head-wrap {
|
||||
background-color: #fff7f5;
|
||||
height: 160rpx;
|
||||
border-radius: 30rpx;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.earnings-head {
|
||||
position: relative;
|
||||
padding-top: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.name {
|
||||
position: absolute;
|
||||
width: 384rpx;
|
||||
height: 74rpx;
|
||||
top: -22rpx;
|
||||
}
|
||||
.content {
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
.money-bg {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
.money-text {
|
||||
margin: 0 6rpx;
|
||||
font-size: 40rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
.earnings-body {
|
||||
padding: 0 30rpx;
|
||||
.earnings-tab {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
height: 100rpx;
|
||||
font-size: 30rpx;
|
||||
color: #e93224;
|
||||
margin-bottom: 10rpx;
|
||||
text.active {
|
||||
position: relative;
|
||||
font-weight: bold;
|
||||
&::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
height: 4rpx;
|
||||
width: 86rpx;
|
||||
left: 50%;
|
||||
bottom: -4rpx;
|
||||
transform: translateX(-50%);
|
||||
background-color: #e93224;
|
||||
}
|
||||
}
|
||||
}
|
||||
.earnings-content-wrap {
|
||||
max-height: 440rpx;
|
||||
}
|
||||
.earnings-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.item-img {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
margin-right: 20rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.item-time {
|
||||
font-size: $font-size-tag;
|
||||
color: $color-tip;
|
||||
}
|
||||
.item-name {
|
||||
line-height: 1.3;
|
||||
}
|
||||
.money {
|
||||
margin-left: auto;
|
||||
color: #f9b124;
|
||||
}
|
||||
}
|
||||
}
|
||||
.earnings-empty {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 160rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
.activity-rules {
|
||||
position: relative;
|
||||
margin-top: 60rpx;
|
||||
min-height: 300rpx;
|
||||
.rules-name {
|
||||
position: absolute;
|
||||
width: 384rpx;
|
||||
height: 74rpx;
|
||||
top: -22rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
.content {
|
||||
padding: 70rpx 20rpx 0;
|
||||
}
|
||||
.rules-empty {
|
||||
padding-top: 140rpx;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.active-btn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #ff2d46;
|
||||
height: 160rpx;
|
||||
padding: 0 60rpx;
|
||||
|
||||
button {
|
||||
flex: 1;
|
||||
margin: 0;
|
||||
border-radius: 50rpx;
|
||||
color: #985400;
|
||||
background: linear-gradient(45deg, #ffe2ac 0%, #fdc174 100%);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="fenxiao-promote" :style="themeColor + ';' + { backgroundImage: 'url(' + $util.img('public/uniapp/fenxiao/promote/promote_bg.png') + ')' }">
|
||||
<view class="my-earnings">
|
||||
<view class="earnings-head-wrap">
|
||||
<view class="earnings-head">
|
||||
<image class="name" :src="$util.img('public/uniapp/fenxiao/promote/my_earnings.png')" mode="aspectFit"></image>
|
||||
<image class="money-bg" :src="$util.img('public/uniapp/fenxiao/promote/money.png')" mode="aspectFill"></image>
|
||||
<view class="content">
|
||||
累计收益
|
||||
<text class="money-text">{{ detailData.total_commission }}</text>
|
||||
元
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="earnings-body">
|
||||
<view class="earnings-tab">
|
||||
<text :class="{ active: tabIndex == 0 }" @click="tabCut(0)">已邀请好友</text>
|
||||
<text :class="{ active: tabIndex == 1 }" @click="tabCut(1)">已下单好友</text>
|
||||
</view>
|
||||
<scroll-view scroll-y="true" class="earnings-content-wrap" @scrolltolower="getTeam()">
|
||||
<view class="earnings-list" v-if="promote.list.length">
|
||||
<view class="earnings-item" v-for="(item, index) in promote.list" :key="index">
|
||||
<image
|
||||
class="item-img"
|
||||
:src="item.headimg ? $util.img(item.headimg) : $util.getDefaultImage().head"
|
||||
@error="item.headimg = $util.getDefaultImage().head"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
<view class="item-content">
|
||||
<view class="item-name multi-hidden">{{ item.nickname }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="earnings-empty" v-else>暂无已邀请好友,快去邀请吧</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="activity-rules">
|
||||
<image class="rules-name" :src="$util.img('public/uniapp/fenxiao/promote/activity_rules.png')" mode="aspectFit"></image>
|
||||
<view class="content" v-if="promoteContent.content"><rich-text :nodes="promoteContent.content"></rich-text></view>
|
||||
<view class="rules-empty" v-else>暂无活动规则</view>
|
||||
</view>
|
||||
<view class="active-btn"><button type="primary" @click="toPoster()">邀请好友</button></view>
|
||||
<ns-copyright></ns-copyright>
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<!-- 小程序隐私协议 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import htmlParser from '@/common/js/html-parser';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tabIndex: 0,
|
||||
promoteContent: {},
|
||||
promote: {
|
||||
page: 0,
|
||||
page_size: 5,
|
||||
page_count: 0,
|
||||
list: []
|
||||
},
|
||||
isPay: 0,
|
||||
detailData: {},
|
||||
templateId: '',
|
||||
poster:'',
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
setTimeout( () => {
|
||||
if (!this.addonIsExist.fenxiao) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启分销',
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/index/index');
|
||||
}, 2000);
|
||||
}
|
||||
},1000);
|
||||
|
||||
if (this.storeToken) {
|
||||
this.getTeam();
|
||||
this.getPromoteRule();
|
||||
this.getFenxiaoDetail();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_promotion/fenxiao/promote_code');
|
||||
});
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getTemplateId();
|
||||
this.getPoster();
|
||||
},
|
||||
methods: {
|
||||
toPoster(){
|
||||
this.$util.redirectTo('/pages_promotion/fenxiao/promote_code', { poster: this.poster,templateId:this.templateId })
|
||||
},
|
||||
tabCut(index) {
|
||||
this.tabIndex = index;
|
||||
this.isPay = index;
|
||||
|
||||
this.promote.page_count = 0;
|
||||
this.promote.page = 0;
|
||||
this.promote.page_size = 5;
|
||||
this.getTeam();
|
||||
},
|
||||
getTeam() {
|
||||
if (this.promote.page_count > 0 && this.promote.page == this.promote.page_count) return;
|
||||
this.promote.page++;
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/team',
|
||||
data: {
|
||||
page: this.promote.page,
|
||||
page_size: this.promote.page_size,
|
||||
is_pay: this.isPay,
|
||||
level: 1
|
||||
},
|
||||
success: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
if (res.code >= 0) {
|
||||
if (this.promote.page == 1) this.promote.list = [];
|
||||
this.promote.page_count = res.data.page_count;
|
||||
this.promote.list = this.promote.list.concat(res.data.list);
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取分销商信息
|
||||
getFenxiaoDetail() {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/detail',
|
||||
success: res => {
|
||||
if (res.data) {
|
||||
this.detailData = res.data;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取富文本
|
||||
getPromoteRule() {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/config/promoterule',
|
||||
success: res => {
|
||||
if (res.data) {
|
||||
this.promoteContent = res.data;
|
||||
this.promoteContent.content = res.data.content ? htmlParser(res.data.content) : '';
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取分享海报
|
||||
*/
|
||||
getPoster() {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/posterList',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.poster = res.data.toString();
|
||||
this.poster = encodeURIComponent(this.poster);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取分享海报id
|
||||
*/
|
||||
getTemplateId() {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/posterTemplateIds',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.templateId = [...res.data].join();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.fenxiao-promote {
|
||||
overflow: hidden;
|
||||
padding: 0 30rpx 160rpx;
|
||||
min-height: 100vh;
|
||||
background-color: #ff2d46;
|
||||
background-size: 100%;
|
||||
background-repeat: no-repeat;
|
||||
.my-earnings,
|
||||
.activity-rules {
|
||||
background-color: #fff;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
.my-earnings {
|
||||
margin-top: 230rpx;
|
||||
padding-bottom: 40rpx;
|
||||
.earnings-head-wrap {
|
||||
background-color: #fff7f5;
|
||||
height: 160rpx;
|
||||
border-radius: 30rpx;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.earnings-head {
|
||||
position: relative;
|
||||
padding-top: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.name {
|
||||
position: absolute;
|
||||
width: 384rpx;
|
||||
height: 74rpx;
|
||||
top: -22rpx;
|
||||
}
|
||||
.content {
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
.money-bg {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
.money-text {
|
||||
margin: 0 6rpx;
|
||||
font-size: 40rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
.earnings-body {
|
||||
padding: 0 30rpx;
|
||||
.earnings-tab {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
height: 100rpx;
|
||||
font-size: 30rpx;
|
||||
color: #e93224;
|
||||
margin-bottom: 10rpx;
|
||||
text.active {
|
||||
position: relative;
|
||||
font-weight: bold;
|
||||
&::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
height: 4rpx;
|
||||
width: 86rpx;
|
||||
left: 50%;
|
||||
bottom: -4rpx;
|
||||
transform: translateX(-50%);
|
||||
background-color: #e93224;
|
||||
}
|
||||
}
|
||||
}
|
||||
.earnings-content-wrap {
|
||||
max-height: 440rpx;
|
||||
}
|
||||
.earnings-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.item-img {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
margin-right: 20rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.item-time {
|
||||
font-size: $font-size-tag;
|
||||
color: $color-tip;
|
||||
}
|
||||
.item-name {
|
||||
line-height: 1.3;
|
||||
}
|
||||
.money {
|
||||
margin-left: auto;
|
||||
color: #f9b124;
|
||||
}
|
||||
}
|
||||
}
|
||||
.earnings-empty {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 160rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
.activity-rules {
|
||||
position: relative;
|
||||
margin-top: 60rpx;
|
||||
min-height: 300rpx;
|
||||
.rules-name {
|
||||
position: absolute;
|
||||
width: 384rpx;
|
||||
height: 74rpx;
|
||||
top: -22rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
.content {
|
||||
padding: 70rpx 20rpx 0;
|
||||
}
|
||||
.rules-empty {
|
||||
padding-top: 140rpx;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.active-btn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #ff2d46;
|
||||
height: 160rpx;
|
||||
padding: 0 60rpx;
|
||||
|
||||
button {
|
||||
flex: 1;
|
||||
margin: 0;
|
||||
border-radius: 50rpx;
|
||||
color: #985400;
|
||||
background: linear-gradient(45deg, #ffe2ac 0%, #fdc174 100%);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,307 +1,306 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="container">
|
||||
<swiper class="swiper" @change="getIndex">
|
||||
<swiper-item v-for="(item, index) in poster" :key="index">
|
||||
<view class="swiper-item">
|
||||
<view class="poster-wrap">
|
||||
<image :src="$util.img(item)" mode="widthFix" :show-menu-by-longpress="true"/>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="tips">长按识别图中二维码</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef MP -->
|
||||
<view class="btn color-base-bg color-base-border" @click="save">保存海报</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<uni-popup ref="popupDialog" :custom="true" :mask-click="false">
|
||||
<view class="dialog-popup">
|
||||
<view class="title">提示</view>
|
||||
<view class="message">您拒绝了保存图片到相册的授权请求,无法保存图片到相册,如需正常使用,请授权之后再进行操作。</view>
|
||||
<view class="action-wrap">
|
||||
<view @click="closeDialog">取消</view>
|
||||
<view>
|
||||
<button type="default" open-type="openSetting" @opensetting="closeDialog" hover-class="none">立即授权</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<!-- 小程序隐私协议 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
Weixin
|
||||
} from 'common/js/wx-jssdk.js';
|
||||
import uniPopup from '@/components/uni-popup/uni-popup.vue';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
poster: [],
|
||||
fenxiaoInfo: {},
|
||||
posterIndex: 0,
|
||||
//海报模板id
|
||||
templateId: ['default'],
|
||||
mpShareData: null //小程序分享数据
|
||||
};
|
||||
},
|
||||
components: {
|
||||
uniPopup
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取分销海报
|
||||
*/
|
||||
getPoster(id) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/poster',
|
||||
data: {
|
||||
page: '/pages/index/index',
|
||||
qrcode_param: JSON.stringify({}),
|
||||
template_id: id
|
||||
},
|
||||
success: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
if (res.code >= 0) {
|
||||
resolve(res.data.path);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
reject();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
getIndex(e) {
|
||||
this.posterIndex = e.detail.current;
|
||||
},
|
||||
save() {
|
||||
// #ifdef MP
|
||||
uni.downloadFile({
|
||||
url: this.$util.img(this.poster[this.posterIndex]),
|
||||
success: res => {
|
||||
if (res.statusCode === 200) {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
this.$util.showToast({
|
||||
title: '保存成功'
|
||||
});
|
||||
},
|
||||
fail: res => {
|
||||
if (res.errMsg == 'saveImageToPhotosAlbum:fail auth deny' ||
|
||||
res.errMsg == 'saveImageToPhotosAlbum:fail:auth denied') {
|
||||
this.$refs.popupDialog.open();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '保存失败,请稍后重试'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '下载失败'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.$util.showToast({
|
||||
title: '下载失败'
|
||||
});
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
getFenxiaoDetail() {
|
||||
this.poster = [];
|
||||
try {
|
||||
this.templateId.forEach((item, index) => {
|
||||
this.getPoster(item).then(resolve => {
|
||||
this.poster.push(resolve);
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}).catch(reject => {
|
||||
throw reject;
|
||||
});
|
||||
});
|
||||
} catch {
|
||||
this.$util.showToast({
|
||||
title: '海报生成失败'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
closeDialog() {
|
||||
this.$refs.popupDialog.close();
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
setTimeout( () => {
|
||||
if (!this.addonIsExist.fenxiao) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启分销',
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/index/index');
|
||||
}, 2000);
|
||||
}
|
||||
},1000);
|
||||
|
||||
if (option.templateId) {
|
||||
this.templateId = option.templateId.split(',');
|
||||
}
|
||||
|
||||
if (this.storeToken) {
|
||||
if(option.poster){
|
||||
this.poster = decodeURIComponent(option.poster).split(',')
|
||||
setTimeout(() => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}, 500)
|
||||
}else{
|
||||
this.getFenxiaoDetail();
|
||||
}
|
||||
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_promotion/fenxiao/promote_code');
|
||||
});
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
//小程序分享
|
||||
// #ifdef MP-WEIXIN
|
||||
this.$util.getMpShare().then(res => {
|
||||
this.mpShareData = res;
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
//分享给好友
|
||||
onShareAppMessage() {
|
||||
return this.mpShareData.appMessage;
|
||||
},
|
||||
//分享到朋友圈
|
||||
onShareTimeline() {
|
||||
return this.mpShareData.timeLine;
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.getFenxiaoDetail();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
width: 100vw;
|
||||
min-height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.poster-wrap {
|
||||
padding: 40rpx 0;
|
||||
width: calc(100vw - 80rpx);
|
||||
margin: 0 40rpx;
|
||||
line-height: 1;
|
||||
|
||||
image {
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.swiper {
|
||||
height: 1240rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 0 80rpx;
|
||||
margin-top: 30rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: $border-radius;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tips {
|
||||
text-align: center;
|
||||
font-size: $font-size-base;
|
||||
color: #999;
|
||||
font-weight: 600;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.dialog-popup {
|
||||
width: 580rpx;
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
height: initial;
|
||||
|
||||
.title {
|
||||
padding: 30rpx 30rpx 0 30rpx;
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.message {
|
||||
padding: 0 30rpx;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
font-size: $font-size-base;
|
||||
line-height: 1.3;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.action-wrap {
|
||||
margin-top: 50rpx;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
border-top: 2rpx solid #eee;
|
||||
|
||||
&>view {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
|
||||
&:first-child {
|
||||
border-right: 2rpx solid #eee;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
button {
|
||||
border: none;
|
||||
line-height: 80rpx;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<swiper class="swiper" @change="getIndex">
|
||||
<swiper-item v-for="(item, index) in poster" :key="index">
|
||||
<view class="swiper-item">
|
||||
<view class="poster-wrap">
|
||||
<image :src="$util.img(item)" mode="widthFix" :show-menu-by-longpress="true"/>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="tips">长按识别图中二维码</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef MP -->
|
||||
<view class="btn color-base-bg color-base-border" @click="save">保存海报</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<uni-popup ref="popupDialog" :custom="true" :mask-click="false">
|
||||
<view class="dialog-popup">
|
||||
<view class="title">提示</view>
|
||||
<view class="message">您拒绝了保存图片到相册的授权请求,无法保存图片到相册,如需正常使用,请授权之后再进行操作。</view>
|
||||
<view class="action-wrap">
|
||||
<view @click="closeDialog">取消</view>
|
||||
<view>
|
||||
<button type="default" open-type="openSetting" @opensetting="closeDialog" hover-class="none">立即授权</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<!-- 小程序隐私协议 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
Weixin
|
||||
} from 'common/js/wx-jssdk.js';
|
||||
import uniPopup from '@/components/uni-popup/uni-popup.vue';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
poster: [],
|
||||
fenxiaoInfo: {},
|
||||
posterIndex: 0,
|
||||
//海报模板id
|
||||
templateId: ['default'],
|
||||
mpShareData: null //小程序分享数据
|
||||
};
|
||||
},
|
||||
components: {
|
||||
uniPopup
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取分销海报
|
||||
*/
|
||||
getPoster(id) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/poster',
|
||||
data: {
|
||||
page: '/pages/index/index',
|
||||
qrcode_param: JSON.stringify({}),
|
||||
template_id: id
|
||||
},
|
||||
success: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
if (res.code >= 0) {
|
||||
resolve(res.data.path);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
reject();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
getIndex(e) {
|
||||
this.posterIndex = e.detail.current;
|
||||
},
|
||||
save() {
|
||||
// #ifdef MP
|
||||
uni.downloadFile({
|
||||
url: this.$util.img(this.poster[this.posterIndex]),
|
||||
success: res => {
|
||||
if (res.statusCode === 200) {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
this.$util.showToast({
|
||||
title: '保存成功'
|
||||
});
|
||||
},
|
||||
fail: res => {
|
||||
if (res.errMsg == 'saveImageToPhotosAlbum:fail auth deny' ||
|
||||
res.errMsg == 'saveImageToPhotosAlbum:fail:auth denied') {
|
||||
this.$refs.popupDialog.open();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '保存失败,请稍后重试'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '下载失败'
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.$util.showToast({
|
||||
title: '下载失败'
|
||||
});
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
getFenxiaoDetail() {
|
||||
this.poster = [];
|
||||
try {
|
||||
this.templateId.forEach((item, index) => {
|
||||
this.getPoster(item).then(resolve => {
|
||||
this.poster.push(resolve);
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}).catch(reject => {
|
||||
throw reject;
|
||||
});
|
||||
});
|
||||
} catch {
|
||||
this.$util.showToast({
|
||||
title: '海报生成失败'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
closeDialog() {
|
||||
this.$refs.popupDialog.close();
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
setTimeout( () => {
|
||||
if (!this.addonIsExist.fenxiao) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启分销',
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/index/index');
|
||||
}, 2000);
|
||||
}
|
||||
},1000);
|
||||
|
||||
if (option.templateId) {
|
||||
this.templateId = option.templateId.split(',');
|
||||
}
|
||||
|
||||
if (this.storeToken) {
|
||||
if(option.poster){
|
||||
this.poster = decodeURIComponent(option.poster).split(',')
|
||||
setTimeout(() => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}, 500)
|
||||
}else{
|
||||
this.getFenxiaoDetail();
|
||||
}
|
||||
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_promotion/fenxiao/promote_code');
|
||||
});
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
//小程序分享
|
||||
// #ifdef MP-WEIXIN
|
||||
this.$util.getMpShare().then(res => {
|
||||
this.mpShareData = res;
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
//分享给好友
|
||||
onShareAppMessage() {
|
||||
return this.mpShareData.appMessage;
|
||||
},
|
||||
//分享到朋友圈
|
||||
onShareTimeline() {
|
||||
return this.mpShareData.timeLine;
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.getFenxiaoDetail();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
width: 100vw;
|
||||
min-height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.poster-wrap {
|
||||
padding: 40rpx 0;
|
||||
width: calc(100vw - 80rpx);
|
||||
margin: 0 40rpx;
|
||||
line-height: 1;
|
||||
|
||||
image {
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.swiper {
|
||||
height: 1240rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 0 80rpx;
|
||||
margin-top: 30rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: $border-radius;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tips {
|
||||
text-align: center;
|
||||
font-size: $font-size-base;
|
||||
color: #999;
|
||||
font-weight: 600;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.dialog-popup {
|
||||
width: 580rpx;
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
height: initial;
|
||||
|
||||
.title {
|
||||
padding: 30rpx 30rpx 0 30rpx;
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.message {
|
||||
padding: 0 30rpx;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
font-size: $font-size-base;
|
||||
line-height: 1.3;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.action-wrap {
|
||||
margin-top: 50rpx;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
border-top: 2rpx solid #eee;
|
||||
|
||||
&>view {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
|
||||
&:first-child {
|
||||
border-right: 2rpx solid #eee;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
button {
|
||||
border: none;
|
||||
line-height: 80rpx;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,416 +1,415 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="container">
|
||||
<mescroll-uni ref="mescroll" @getData="getData" top="0" :size="10">
|
||||
<view slot="list">
|
||||
<block v-if="list.length != 0">
|
||||
<view class="banner" :style="{background: 'url('+ $util.img('public/uniapp/fenxiao/index/header_bg.png') +') no-repeat top left / 100% 100%'}">
|
||||
<view class="info">
|
||||
<view class="info-pic">
|
||||
<image :src="info.headimg ? $util.img(info.headimg) : $util.getDefaultImage().head" @error="info.headimg = $util.getDefaultImage().head" mode="aspectFill"/>
|
||||
</view>
|
||||
<view class="member-info">
|
||||
<view class="rank-info-box">
|
||||
<text class="name">{{info.nickname}}</text>
|
||||
</view>
|
||||
<view class="withdrawal" @click="$util.redirectTo('/pages_promotion/fenxiao/withdraw_apply')" v-if="type == 'profit'">点击提现</view>
|
||||
<view class="withdrawal" @click="$util.redirectTo('/pages_promotion/fenxiao/team')" v-if="type == 'invited_num'">我的团队</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="fenxiao-team" v-if="type == 'profit'">
|
||||
<view class="fenxiao-index-other">
|
||||
<view class="all-money-item">
|
||||
<view class="img-wrap">
|
||||
<text class="iconfont icon-fenxiao"></text>
|
||||
</view>
|
||||
<view class="all-money-tit-wrap">
|
||||
<text class="all-money-tit">分销佣金</text>
|
||||
<text class="all-money-num">{{ info.today_commission}}元</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fenxiao-index-other">
|
||||
<view class="all-money-item">
|
||||
<view class="img-wrap">
|
||||
<text class="iconfont icon-baixingbeng"></text>
|
||||
</view>
|
||||
<view class="all-money-tit-wrap">
|
||||
<text class="all-money-tit">佣金排行</text>
|
||||
<text class="all-money-num">您排行第{{ ranking }}名</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fenxiao-team" v-if="type == 'invited_num'">
|
||||
<view class="fenxiao-index-other">
|
||||
<view class="all-money-item">
|
||||
<view class="img-wrap">
|
||||
<text class="iconfont icon-huodongtuiyan"></text>
|
||||
</view>
|
||||
<view class="all-money-tit-wrap">
|
||||
<text class="all-money-tit">推广人数</text>
|
||||
<text class="all-money-num">{{ info.one_child_num}}人</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fenxiao-index-other">
|
||||
<view class="all-money-item">
|
||||
<view class="img-wrap">
|
||||
<text class="iconfont icon-baixingbeng"></text>
|
||||
</view>
|
||||
<view class="all-money-tit-wrap">
|
||||
<text class="all-money-tit" v-if="type == 'invited_num'">推广排行</text>
|
||||
<text class="all-money-num">您排行第{{ ranking }}名</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="title-rakn-text" v-if="type == 'profit'">佣金排行</view>
|
||||
<view class="title-rakn-text" v-if="type == 'invited_num'">推广排行</view>
|
||||
|
||||
<view class="ranking-list">
|
||||
<view class="ranking-item" v-for="(item, index) in list" :key="index">
|
||||
<view class="ranking price-font">{{ index + 1 }}</view>
|
||||
<view class="content">
|
||||
<view class="head-img">
|
||||
<image :src="item.headimg ? $util.img(item.headimg) : $util.getDefaultImage().head" @error="item.headimg = $util.getDefaultImage().head" mode="aspectFill"/>
|
||||
</view>
|
||||
<view class="nickname">{{ item.nickname }}</view>
|
||||
</view>
|
||||
<view class="price-font price-style" v-if="type == 'profit'">
|
||||
¥{{ item.total_commission|moneyFormat }}</view>
|
||||
<view class="price-font price-style" v-if="type == 'invited_num'">{{ item.child_num }}人
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="list.length == 0 && emptyShow">
|
||||
<ns-empty text="暂无数据" :isIndex="false"></ns-empty>
|
||||
</block>
|
||||
</view>
|
||||
</mescroll-uni>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
emptyShow: false,
|
||||
type: '',
|
||||
ranking: 0,
|
||||
info: {}
|
||||
}
|
||||
},
|
||||
onLoad(data) {
|
||||
this.type = data.type;
|
||||
this.getRanking();
|
||||
this.getFenxiaoDetail();
|
||||
},
|
||||
methods: {
|
||||
getData(mescroll) {
|
||||
this.emptyShow = false;
|
||||
if (mescroll.num == 1) {
|
||||
this.list = [];
|
||||
}
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/rankinglist',
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num,
|
||||
type: this.type
|
||||
},
|
||||
success: res => {
|
||||
this.emptyShow = true;
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
|
||||
this.list = this.list.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
getRanking() {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/ranking',
|
||||
data: {
|
||||
type: this.type
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.ranking = res.data;
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getFenxiaoDetail() {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/detail',
|
||||
success: res => {
|
||||
if (res.data) {
|
||||
this.info = res.data;
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.banner {
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
// background: $base-color;
|
||||
}
|
||||
|
||||
.info {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 50rpx 80rpx 0;
|
||||
box-sizing: border-box;
|
||||
|
||||
.info-pic {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
border: 4rpx solid #fff;
|
||||
position: relative;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.member-info {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
margin-left: 32rpx;
|
||||
display: flex;
|
||||
|
||||
view {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.rank-info-box {
|
||||
line-height: 1;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.withdrawal {
|
||||
border-radius: 4px;
|
||||
line-height: 23px;
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.fenxiao-team {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
margin-top: 22rpx;
|
||||
|
||||
.fenxiao-index-other {
|
||||
margin: 0 24rpx 20rpx 24rpx;
|
||||
border-radius: 16rpx;
|
||||
background-color: #ffffff;
|
||||
padding: 30rpx 0;
|
||||
flex: 1;
|
||||
|
||||
&:last-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.all-money-item {
|
||||
margin: 0 30rpx;
|
||||
display: flex;
|
||||
font-size: $font-size-tag;
|
||||
align-items: center;
|
||||
|
||||
.img-wrap {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.all-money-tit-wrap {
|
||||
flex: 1;
|
||||
margin-left: 24rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 70rpx;
|
||||
|
||||
.all-money-tit {
|
||||
line-height: 1;
|
||||
color: $color-title;
|
||||
font-size: $font-size-base;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.all-money-num {
|
||||
color: $color-tip;
|
||||
font-size: 24rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.icon-wenxiao {
|
||||
text-align: center;
|
||||
font-size: 50rpx;
|
||||
color: var(--base-color) !important;
|
||||
}
|
||||
|
||||
.number {
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.info-text {
|
||||
font-size: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.info-title {
|
||||
font-size: 50rpx;
|
||||
font-weight: 900;
|
||||
color: #f5f5f5;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.info-rank {
|
||||
color: #f5f5f5;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.title-rakn-text {
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.ranking-list {
|
||||
transform: translateY(-120rpx);
|
||||
margin: 200rpx 24rpx;
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
margin-top: 140rpx;
|
||||
|
||||
.ranking-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 2rpx solid #f5f5f5;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.ranking {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
&:nth-child(1) .ranking {
|
||||
background: rgb(249, 186, 1);
|
||||
border-radius: 50%;
|
||||
border: 10rpx solid rgb(254, 220, 92);
|
||||
}
|
||||
|
||||
&:nth-child(2) .ranking {
|
||||
background: rgb(172, 185, 194);
|
||||
border-radius: 50%;
|
||||
border: 10rpx solid rgb(215, 223, 229);
|
||||
}
|
||||
|
||||
&:nth-child(3) .ranking {
|
||||
background: rgb(211, 163, 136);
|
||||
border-radius: 50%;
|
||||
border: 10rpx solid rgb(235, 201, 190);
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
padding: 0 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.head-img {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.nickname {
|
||||
color: #333;
|
||||
margin: 0 20rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<mescroll-uni ref="mescroll" @getData="getData" top="0" :size="10">
|
||||
<view slot="list">
|
||||
<block v-if="list.length != 0">
|
||||
<view class="banner" :style="{background: 'url('+ $util.img('public/uniapp/fenxiao/index/header_bg.png') +') no-repeat top left / 100% 100%'}">
|
||||
<view class="info">
|
||||
<view class="info-pic">
|
||||
<image :src="info.headimg ? $util.img(info.headimg) : $util.getDefaultImage().head" @error="info.headimg = $util.getDefaultImage().head" mode="aspectFill"/>
|
||||
</view>
|
||||
<view class="member-info">
|
||||
<view class="rank-info-box">
|
||||
<text class="name">{{info.nickname}}</text>
|
||||
</view>
|
||||
<view class="withdrawal" @click="$util.redirectTo('/pages_promotion/fenxiao/withdraw_apply')" v-if="type == 'profit'">点击提现</view>
|
||||
<view class="withdrawal" @click="$util.redirectTo('/pages_promotion/fenxiao/team')" v-if="type == 'invited_num'">我的团队</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="fenxiao-team" v-if="type == 'profit'">
|
||||
<view class="fenxiao-index-other">
|
||||
<view class="all-money-item">
|
||||
<view class="img-wrap">
|
||||
<text class="iconfont icon-fenxiao"></text>
|
||||
</view>
|
||||
<view class="all-money-tit-wrap">
|
||||
<text class="all-money-tit">分销佣金</text>
|
||||
<text class="all-money-num">{{ info.today_commission}}元</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fenxiao-index-other">
|
||||
<view class="all-money-item">
|
||||
<view class="img-wrap">
|
||||
<text class="iconfont icon-baixingbeng"></text>
|
||||
</view>
|
||||
<view class="all-money-tit-wrap">
|
||||
<text class="all-money-tit">佣金排行</text>
|
||||
<text class="all-money-num">您排行第{{ ranking }}名</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fenxiao-team" v-if="type == 'invited_num'">
|
||||
<view class="fenxiao-index-other">
|
||||
<view class="all-money-item">
|
||||
<view class="img-wrap">
|
||||
<text class="iconfont icon-huodongtuiyan"></text>
|
||||
</view>
|
||||
<view class="all-money-tit-wrap">
|
||||
<text class="all-money-tit">推广人数</text>
|
||||
<text class="all-money-num">{{ info.one_child_num}}人</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fenxiao-index-other">
|
||||
<view class="all-money-item">
|
||||
<view class="img-wrap">
|
||||
<text class="iconfont icon-baixingbeng"></text>
|
||||
</view>
|
||||
<view class="all-money-tit-wrap">
|
||||
<text class="all-money-tit" v-if="type == 'invited_num'">推广排行</text>
|
||||
<text class="all-money-num">您排行第{{ ranking }}名</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="title-rakn-text" v-if="type == 'profit'">佣金排行</view>
|
||||
<view class="title-rakn-text" v-if="type == 'invited_num'">推广排行</view>
|
||||
|
||||
<view class="ranking-list">
|
||||
<view class="ranking-item" v-for="(item, index) in list" :key="index">
|
||||
<view class="ranking price-font">{{ index + 1 }}</view>
|
||||
<view class="content">
|
||||
<view class="head-img">
|
||||
<image :src="item.headimg ? $util.img(item.headimg) : $util.getDefaultImage().head" @error="item.headimg = $util.getDefaultImage().head" mode="aspectFill"/>
|
||||
</view>
|
||||
<view class="nickname">{{ item.nickname }}</view>
|
||||
</view>
|
||||
<view class="price-font price-style" v-if="type == 'profit'">
|
||||
¥{{ item.total_commission|moneyFormat }}</view>
|
||||
<view class="price-font price-style" v-if="type == 'invited_num'">{{ item.child_num }}人
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="list.length == 0 && emptyShow">
|
||||
<ns-empty text="暂无数据" :isIndex="false"></ns-empty>
|
||||
</block>
|
||||
</view>
|
||||
</mescroll-uni>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
emptyShow: false,
|
||||
type: '',
|
||||
ranking: 0,
|
||||
info: {}
|
||||
}
|
||||
},
|
||||
onLoad(data) {
|
||||
this.type = data.type;
|
||||
this.getRanking();
|
||||
this.getFenxiaoDetail();
|
||||
},
|
||||
methods: {
|
||||
getData(mescroll) {
|
||||
this.emptyShow = false;
|
||||
if (mescroll.num == 1) {
|
||||
this.list = [];
|
||||
}
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/rankinglist',
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num,
|
||||
type: this.type
|
||||
},
|
||||
success: res => {
|
||||
this.emptyShow = true;
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
|
||||
this.list = this.list.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
getRanking() {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/ranking',
|
||||
data: {
|
||||
type: this.type
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.ranking = res.data;
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getFenxiaoDetail() {
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/detail',
|
||||
success: res => {
|
||||
if (res.data) {
|
||||
this.info = res.data;
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.banner {
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
// background: $base-color;
|
||||
}
|
||||
|
||||
.info {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 50rpx 80rpx 0;
|
||||
box-sizing: border-box;
|
||||
|
||||
.info-pic {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
border: 4rpx solid #fff;
|
||||
position: relative;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.member-info {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
margin-left: 32rpx;
|
||||
display: flex;
|
||||
|
||||
view {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.rank-info-box {
|
||||
line-height: 1;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.withdrawal {
|
||||
border-radius: 4px;
|
||||
line-height: 23px;
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.fenxiao-team {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
margin-top: 22rpx;
|
||||
|
||||
.fenxiao-index-other {
|
||||
margin: 0 24rpx 20rpx 24rpx;
|
||||
border-radius: 16rpx;
|
||||
background-color: #ffffff;
|
||||
padding: 30rpx 0;
|
||||
flex: 1;
|
||||
|
||||
&:last-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.all-money-item {
|
||||
margin: 0 30rpx;
|
||||
display: flex;
|
||||
font-size: $font-size-tag;
|
||||
align-items: center;
|
||||
|
||||
.img-wrap {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.all-money-tit-wrap {
|
||||
flex: 1;
|
||||
margin-left: 24rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 70rpx;
|
||||
|
||||
.all-money-tit {
|
||||
line-height: 1;
|
||||
color: $color-title;
|
||||
font-size: $font-size-base;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.all-money-num {
|
||||
color: $color-tip;
|
||||
font-size: 24rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.icon-wenxiao {
|
||||
text-align: center;
|
||||
font-size: 50rpx;
|
||||
color: var(--base-color) !important;
|
||||
}
|
||||
|
||||
.number {
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.info-text {
|
||||
font-size: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.info-title {
|
||||
font-size: 50rpx;
|
||||
font-weight: 900;
|
||||
color: #f5f5f5;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.info-rank {
|
||||
color: #f5f5f5;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.title-rakn-text {
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.ranking-list {
|
||||
transform: translateY(-120rpx);
|
||||
margin: 200rpx 24rpx;
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
margin-top: 140rpx;
|
||||
|
||||
.ranking-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 2rpx solid #f5f5f5;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.ranking {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
&:nth-child(1) .ranking {
|
||||
background: rgb(249, 186, 1);
|
||||
border-radius: 50%;
|
||||
border: 10rpx solid rgb(254, 220, 92);
|
||||
}
|
||||
|
||||
&:nth-child(2) .ranking {
|
||||
background: rgb(172, 185, 194);
|
||||
border-radius: 50%;
|
||||
border: 10rpx solid rgb(215, 223, 229);
|
||||
}
|
||||
|
||||
&:nth-child(3) .ranking {
|
||||
background: rgb(211, 163, 136);
|
||||
border-radius: 50%;
|
||||
border: 10rpx solid rgb(235, 201, 190);
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
padding: 0 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.head-img {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.nickname {
|
||||
color: #333;
|
||||
margin: 0 20rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni ref="mescroll" @getData="getData" top="20" class="member-point" :size="8" v-if="storeToken">
|
||||
<view class="goods_list" slot="list">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<view class="team-cate" v-if="storeToken && levelNum > 1">
|
||||
<block v-for="(item, index) in levelList" :key="index">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="container">
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="bank-account-wrap" @click="goAccount()">
|
||||
<view class="tx-wrap" v-if="bankAccountInfo.withdraw_type && !isBalance">
|
||||
<text class="tx-to">提现到</text>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni @getData="getData" class="member-point">
|
||||
<view slot="list">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<view class="money-wrap">
|
||||
<text>-{{ detail.money }}</text>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="content">
|
||||
<view class="content" :style="themeColor">
|
||||
<view class="head-wrap">
|
||||
<!-- 搜索区域 -->
|
||||
<view class="search-wrap uni-flex uni-row" style="margin-bottom: 20rpx;">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<view class="category-page-wrap category-template-1" style="height: calc(-56px + 100vh);">
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<view scroll-y="true" class="goods-detail" :class="isIphoneX ? 'active' : ''">
|
||||
<view class="goods-container">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="content">
|
||||
<view class="content" :style="themeColor">
|
||||
<view class="head-wrap">
|
||||
<!-- 搜索区域 -->
|
||||
<view class="search-wrap uni-flex uni-row">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="conteiner">
|
||||
<view class="conteiner" :style="themeColor">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="point-navbar"
|
||||
:style="{'padding-top': menuButtonBounding.top + 'px', height: menuButtonBounding.height + 'px' }">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="order-container">
|
||||
<view class="order-container" :style="themeColor">
|
||||
<view class="order-nav" v-if="storeToken">
|
||||
<view v-for="(statusItem, statusIndex) in statusList" :key="statusIndex" class="uni-tab-item" :id="statusItem.id" :data-current="statusIndex" @click="ontabtap">
|
||||
<text class="uni-tab-item-title" :class="statusItem.status == orderStatus ? 'uni-tab-item-title-active color-base-text' : ''">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="order-container" :class="{ 'safe-area': isIphoneX }">
|
||||
<view class="order-container" :style="themeColor" :class="{ 'safe-area': isIphoneX }">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="payment-navbar" :style="{
|
||||
'padding-top': menuButtonBounding.top + 'px',
|
||||
|
||||
@@ -1,93 +1,92 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="container">
|
||||
<view class="image-wrap">
|
||||
<image :src="$util.img('public/uniapp/pay/pay_success.png')" class="result-image" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="msg">{{ $lang('exchangeSuccess') }}</view>
|
||||
<view class="action">
|
||||
<view class="btn color-base-border color-base-text" @click="toOrderList()">{{ $lang('see') }}</view>
|
||||
<view class="btn go-home color-base-bg" @click="toIndex">{{ $lang('goHome') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
methods: {
|
||||
toOrderList() {
|
||||
this.$util.redirectTo('/pages_promotion/point/order_list', {}, 'redirectTo');
|
||||
},
|
||||
toIndex() {
|
||||
this.$util.redirectTo('/pages/index/index');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: #fff;
|
||||
|
||||
.image-wrap {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 200rpx 0 40rpx 0;
|
||||
|
||||
.result-image {
|
||||
width: 166rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.msg {
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
margin-bottom: 50rpx;
|
||||
font-size: $font-size-base;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.pay-amount {
|
||||
color: #999;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.action {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
margin-top: 150rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.btn {
|
||||
width: 310rpx;
|
||||
height: 78rpx;
|
||||
border: 2rpx solid #ffffff;
|
||||
border-radius: $border-radius;
|
||||
font-size: $font-size-tag;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.alone {
|
||||
margin-left: 0;
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.go-home {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="image-wrap">
|
||||
<image :src="$util.img('public/uniapp/pay/pay_success.png')" class="result-image" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="msg">{{ $lang('exchangeSuccess') }}</view>
|
||||
<view class="action">
|
||||
<view class="btn color-base-border color-base-text" @click="toOrderList()">{{ $lang('see') }}</view>
|
||||
<view class="btn go-home color-base-bg" @click="toIndex">{{ $lang('goHome') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
methods: {
|
||||
toOrderList() {
|
||||
this.$util.redirectTo('/pages_promotion/point/order_list', {}, 'redirectTo');
|
||||
},
|
||||
toIndex() {
|
||||
this.$util.redirectTo('/pages/index/index');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: #fff;
|
||||
|
||||
.image-wrap {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 200rpx 0 40rpx 0;
|
||||
|
||||
.result-image {
|
||||
width: 166rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.msg {
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
margin-bottom: 50rpx;
|
||||
font-size: $font-size-base;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.pay-amount {
|
||||
color: #999;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.action {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
margin-top: 150rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.btn {
|
||||
width: 310rpx;
|
||||
height: 78rpx;
|
||||
border: 2rpx solid #ffffff;
|
||||
border-radius: $border-radius;
|
||||
font-size: $font-size-tag;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.alone {
|
||||
margin-left: 0;
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.go-home {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,55 +1,54 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view style="padding: 20rpx;">
|
||||
<rich-text :nodes="content"></rich-text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import htmlParser from '@/common/js/html-parser';
|
||||
export default {
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
content:'',
|
||||
type:'',
|
||||
uniacid:0
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.type = option.type
|
||||
this.uniacid = option.uniacid?option.uniacid:0
|
||||
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX()
|
||||
this.getcontent()
|
||||
},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
getcontent() {
|
||||
// privacy content
|
||||
var data = {
|
||||
type:this.type
|
||||
}
|
||||
if(this.uniacid > 0) data.uniacid = this.uniacid
|
||||
this.$api.sendRequest({
|
||||
url: '/api/config/agreement',
|
||||
data:data,
|
||||
success: res => {
|
||||
console.log(res.data.title)
|
||||
uni.setNavigationBarTitle({
|
||||
title:res.data.title
|
||||
})
|
||||
this.content = res.data.content
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
<template>
|
||||
<view style="padding: 20rpx;" :style="themeColor">
|
||||
<rich-text :nodes="content"></rich-text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import htmlParser from '@/common/js/html-parser';
|
||||
export default {
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
content:'',
|
||||
type:'',
|
||||
uniacid:0
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.type = option.type
|
||||
this.uniacid = option.uniacid?option.uniacid:0
|
||||
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX()
|
||||
this.getcontent()
|
||||
},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
getcontent() {
|
||||
// privacy content
|
||||
var data = {
|
||||
type:this.type
|
||||
}
|
||||
if(this.uniacid > 0) data.uniacid = this.uniacid
|
||||
this.$api.sendRequest({
|
||||
url: '/api/config/agreement',
|
||||
data:data,
|
||||
success: res => {
|
||||
console.log(res.data.title)
|
||||
uni.setNavigationBarTitle({
|
||||
title:res.data.title
|
||||
})
|
||||
this.content = res.data.content
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
</style>
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="page">
|
||||
<view class="page" :style="themeColor">
|
||||
<view class="help-title">{{ detail.article_title }}</view>
|
||||
<view class="help-meta" v-if="detail.is_show_release_time == 1">
|
||||
<text class="help-time">发表时间: {{ $util.timeStampTurnTime(detail.create_time) }}</text>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni @getData="getData" ref="mescroll">
|
||||
<block slot="list">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<view class="about w100">
|
||||
<view class="bg border-top"></view>
|
||||
@@ -146,9 +145,9 @@
|
||||
</uni-popup>
|
||||
</view>
|
||||
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||
<hover-nav></hover-nav>
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</view>
|
||||
<hover-nav></hover-nav>
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view>
|
||||
<view :style="themeColor">
|
||||
<view class="page" v-if="detail">
|
||||
<view class="form-banner">
|
||||
<image :src="$util.img('public/uniapp/form/banner.png')" mode="widthFix"></image>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<view class="cf-container color-line-border">
|
||||
<view class="tab">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="container">
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="content">
|
||||
<view class="wx-code">
|
||||
<image :src="$util.img(path)" />
|
||||
|
||||
@@ -1,342 +1,341 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="goods-evaluate">
|
||||
<view class="evaluate-tab">
|
||||
<view v-for="(item, index) in evaluateList" :key="index" :class="evaluateTab == item.value ? 'active-tab' : ''" @click="onEvaluateTab(item.value)">
|
||||
{{ item.name }}({{ item.count }})
|
||||
</view>
|
||||
</view>
|
||||
<mescroll-uni ref="mescroll" top="100" @getData="getGoodsEvaluate">
|
||||
<block slot="list">
|
||||
<view class="evaluate-item" v-for="(item, index) in list" :key="index">
|
||||
<view class="evaluator">
|
||||
<view>
|
||||
<view class="evaluator-face">
|
||||
<image v-if="item.member_headimg" :src="$util.img(item.member_headimg)" @error="imageError(index)" mode="aspectFill" />
|
||||
<image v-else :src="$util.getDefaultImage().head" mode="aspectFill" />
|
||||
</view>
|
||||
|
||||
<view class="evaluator-info">
|
||||
<view class="evaluator-info-left">
|
||||
<view class="evaluator-name using-hidden" v-if="item.member_name.length > 2 && item.is_anonymous == 1">
|
||||
{{ item.member_name[0] }}***{{ item.member_name[item.member_name.length - 1] }}
|
||||
</view>
|
||||
<text class="evaluator-name using-hidden" v-else>{{ item.member_name }}</text>
|
||||
<view class="evaluator-time color-tip">{{ $util.timeStampTurnTime(item.create_time) }}</view>
|
||||
</view>
|
||||
<view class="evaluator-xing"><xiaoStarComponent :starCount="item.scores * 2"></xiaoStarComponent></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cont">{{ item.content }}</view>
|
||||
<scroll-view scroll-x="true">
|
||||
<view class="evaluate-img" v-if="item.images">
|
||||
<view class="img-box" v-for="(img, img_index) in item.images" :key="img_index" @click="previewEvaluate(index, img_index, 'images')">
|
||||
<image :src="$util.img(img)" mode="aspectFill" />
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view v-if="item.explain_first != ''" class="time shop-reply-box">
|
||||
<view class="shop-reply">商家回复:</view>
|
||||
<view class="cont">{{ item.explain_first }}</view>
|
||||
</view>
|
||||
|
||||
<template v-if="item.again_content != '' && item.again_is_audit == 1">
|
||||
<view class="review-evaluation color-base-text">追加评价</view>
|
||||
<view class="cont">{{ item.again_content }}</view>
|
||||
<scroll-view scroll-x="true">
|
||||
<view class="evaluate-img" v-if="item.again_images.length > 0">
|
||||
<view
|
||||
class="img-box"
|
||||
v-for="(again_img, again_index) in item.again_images"
|
||||
:key="again_index"
|
||||
@click="previewEvaluate(index, again_index, 'again_images')"
|
||||
>
|
||||
<image :src="$util.img(again_img)" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view v-if="item.again_explain != ''" class="time shop-reply-box">
|
||||
<view class="shop-reply" v-if="item.again_explain != ''">商家回复:</view>
|
||||
<view class="cont">{{ item.again_explain }}</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<view v-if="list.length == 0"><ns-empty text="暂无商品评价"></ns-empty></view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import xiaoStarComponent from '@/components/xiao-star-component/xiao-star-component.vue';
|
||||
export default {
|
||||
components: { xiaoStarComponent },
|
||||
data() {
|
||||
return {
|
||||
goodsId: 0,
|
||||
list: [],
|
||||
evaluateList: [{ name: '全部', value: 0, count: 0 }, { name: '好评', value: 1, count: 0 }, { name: '中评', value: 2, count: 0 }, { name: '差评', value: 3, count: 0 }],
|
||||
evaluateTab: 0,
|
||||
mescroll_type: {}
|
||||
};
|
||||
},
|
||||
onLoad(data) {
|
||||
this.goodsId = data.goods_id || 0;
|
||||
this.getEvaluateCount();
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
methods: {
|
||||
getEvaluateCount(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodsevaluate/getgoodsevaluate',
|
||||
data: {
|
||||
goods_id: this.goodsId
|
||||
},
|
||||
success: res => {
|
||||
for (let i = 0; i < this.evaluateList.length; i++) {
|
||||
if (this.evaluateList[i].value == 0) {
|
||||
this.evaluateList[i].count = res.data.total;
|
||||
} else if (this.evaluateList[i].value == 1) {
|
||||
this.evaluateList[i].count = res.data.haoping;
|
||||
} else if (this.evaluateList[i].value == 2) {
|
||||
this.evaluateList[i].count = res.data.zhongping;
|
||||
} else if (this.evaluateList[i].value == 3) {
|
||||
this.evaluateList[i].count = res.data.chaping;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
getGoodsEvaluate(mescroll) {
|
||||
this.mescroll_type = mescroll;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodsevaluate/page',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size,
|
||||
goods_id: this.goodsId,
|
||||
explain_type: this.evaluateTab == 0 ? '' : this.evaluateTab
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
|
||||
for (var i = 0; i < newArr.length; i++) {
|
||||
if (newArr[i].images) newArr[i].images = newArr[i].images.split(',');
|
||||
if (newArr[i].again_images) newArr[i].again_images = newArr[i].again_images.split(',');
|
||||
if (newArr[i].is_anonymous == 1) newArr[i].member_name = newArr[i].member_name.replace(newArr[i].member_name.substring(1, newArr[i].member_name.length - 1), '***');
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
|
||||
this.list = this.list.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 预览评价图片
|
||||
previewEvaluate(index, img_index, field) {
|
||||
var paths = [];
|
||||
for (let i = 0; i < this.list[index][field].length; i++) {
|
||||
paths.push(this.$util.img(this.list[index][field][i]));
|
||||
}
|
||||
uni.previewImage({
|
||||
current: img_index,
|
||||
urls: paths
|
||||
});
|
||||
},
|
||||
|
||||
imageError(index) {
|
||||
this.list[index].member_headimg = this.$util.getDefaultImage().head;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
onEvaluateTab(value) {
|
||||
this.list = [];
|
||||
this.evaluateTab = value;
|
||||
this.mescroll_type.num = 1;
|
||||
this.mescroll_type.size = 10;
|
||||
let mescrolls = {
|
||||
num: 1,
|
||||
size: 10
|
||||
};
|
||||
this.getGoodsEvaluate(this.mescroll_type);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.goods-evaluate {
|
||||
.evaluate-tab {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
height: 100rpx;
|
||||
padding: 0 $margin-both;
|
||||
|
||||
view {
|
||||
background: #f0f0f0;
|
||||
color: #333;
|
||||
border-radius: 30rpx;
|
||||
margin-right: 20rpx;
|
||||
padding: 8rpx 30rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.active-tab {
|
||||
background-color: $base-color;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.evaluate-item {
|
||||
margin: $margin-updown $margin-both;
|
||||
padding: $margin-both;
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
|
||||
.evaluator {
|
||||
& > view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.evaluator-face {
|
||||
width: 79rpx;
|
||||
height: 79rpx;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.evaluator-info {
|
||||
width: 85%;
|
||||
margin-left: 13rpx;
|
||||
|
||||
.evaluator-name {
|
||||
color: #303133;
|
||||
font-size: $font-size-base;
|
||||
line-height: 1;
|
||||
width: 250rpx;
|
||||
}
|
||||
|
||||
.evaluator-time {
|
||||
font-size: $font-size-tag;
|
||||
// margin-top: 14rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
.evaluator-info-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.cont {
|
||||
text-align: justify;
|
||||
display: -webkit-box;
|
||||
word-break: break-all;
|
||||
font-size: $font-size-base;
|
||||
margin: 26rpx 0 0;
|
||||
color: #000000;
|
||||
line-height: 42rpx;
|
||||
}
|
||||
|
||||
.evaluate-img {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 19rpx;
|
||||
|
||||
.img-box {
|
||||
flex-shrink: 0;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
overflow: hidden;
|
||||
margin: 20rpx 23rpx 0 0;
|
||||
border-radius: 10rpx;
|
||||
|
||||
&:nth-child(4n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
&:nth-child(-n + 4) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: $font-size-tag;
|
||||
background: #f8f8f8;
|
||||
padding: 10rpx 20rpx;
|
||||
border-radius: 6rpx;
|
||||
margin-top: 20rpx;
|
||||
|
||||
text {
|
||||
line-height: 42rpx;
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
|
||||
.evaluation-reply {
|
||||
margin-top: 10rpx;
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
|
||||
.review-evaluation {
|
||||
margin-top: 29rpx;
|
||||
font-size: $font-size-base;
|
||||
line-height: 1;
|
||||
|
||||
.review-time {
|
||||
overflow: hidden;
|
||||
float: right;
|
||||
}
|
||||
|
||||
& + .cont {
|
||||
margin: 18rpx 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.shop-reply {
|
||||
font-size: $font-size-base;
|
||||
color: #000;
|
||||
line-height: 1;
|
||||
|
||||
& + .cont {
|
||||
margin-top: 10rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
.shop-reply-box {
|
||||
padding: 20rpx !important;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="goods-evaluate" :style="themeColor">
|
||||
<view class="evaluate-tab">
|
||||
<view v-for="(item, index) in evaluateList" :key="index" :class="evaluateTab == item.value ? 'active-tab' : ''" @click="onEvaluateTab(item.value)">
|
||||
{{ item.name }}({{ item.count }})
|
||||
</view>
|
||||
</view>
|
||||
<mescroll-uni ref="mescroll" top="100" @getData="getGoodsEvaluate">
|
||||
<block slot="list">
|
||||
<view class="evaluate-item" v-for="(item, index) in list" :key="index">
|
||||
<view class="evaluator">
|
||||
<view>
|
||||
<view class="evaluator-face">
|
||||
<image v-if="item.member_headimg" :src="$util.img(item.member_headimg)" @error="imageError(index)" mode="aspectFill" />
|
||||
<image v-else :src="$util.getDefaultImage().head" mode="aspectFill" />
|
||||
</view>
|
||||
|
||||
<view class="evaluator-info">
|
||||
<view class="evaluator-info-left">
|
||||
<view class="evaluator-name using-hidden" v-if="item.member_name.length > 2 && item.is_anonymous == 1">
|
||||
{{ item.member_name[0] }}***{{ item.member_name[item.member_name.length - 1] }}
|
||||
</view>
|
||||
<text class="evaluator-name using-hidden" v-else>{{ item.member_name }}</text>
|
||||
<view class="evaluator-time color-tip">{{ $util.timeStampTurnTime(item.create_time) }}</view>
|
||||
</view>
|
||||
<view class="evaluator-xing"><xiaoStarComponent :starCount="item.scores * 2"></xiaoStarComponent></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cont">{{ item.content }}</view>
|
||||
<scroll-view scroll-x="true">
|
||||
<view class="evaluate-img" v-if="item.images">
|
||||
<view class="img-box" v-for="(img, img_index) in item.images" :key="img_index" @click="previewEvaluate(index, img_index, 'images')">
|
||||
<image :src="$util.img(img)" mode="aspectFill" />
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view v-if="item.explain_first != ''" class="time shop-reply-box">
|
||||
<view class="shop-reply">商家回复:</view>
|
||||
<view class="cont">{{ item.explain_first }}</view>
|
||||
</view>
|
||||
|
||||
<template v-if="item.again_content != '' && item.again_is_audit == 1">
|
||||
<view class="review-evaluation color-base-text">追加评价</view>
|
||||
<view class="cont">{{ item.again_content }}</view>
|
||||
<scroll-view scroll-x="true">
|
||||
<view class="evaluate-img" v-if="item.again_images.length > 0">
|
||||
<view
|
||||
class="img-box"
|
||||
v-for="(again_img, again_index) in item.again_images"
|
||||
:key="again_index"
|
||||
@click="previewEvaluate(index, again_index, 'again_images')"
|
||||
>
|
||||
<image :src="$util.img(again_img)" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view v-if="item.again_explain != ''" class="time shop-reply-box">
|
||||
<view class="shop-reply" v-if="item.again_explain != ''">商家回复:</view>
|
||||
<view class="cont">{{ item.again_explain }}</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<view v-if="list.length == 0"><ns-empty text="暂无商品评价"></ns-empty></view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import xiaoStarComponent from '@/components/xiao-star-component/xiao-star-component.vue';
|
||||
export default {
|
||||
components: { xiaoStarComponent },
|
||||
data() {
|
||||
return {
|
||||
goodsId: 0,
|
||||
list: [],
|
||||
evaluateList: [{ name: '全部', value: 0, count: 0 }, { name: '好评', value: 1, count: 0 }, { name: '中评', value: 2, count: 0 }, { name: '差评', value: 3, count: 0 }],
|
||||
evaluateTab: 0,
|
||||
mescroll_type: {}
|
||||
};
|
||||
},
|
||||
onLoad(data) {
|
||||
this.goodsId = data.goods_id || 0;
|
||||
this.getEvaluateCount();
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
methods: {
|
||||
getEvaluateCount(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodsevaluate/getgoodsevaluate',
|
||||
data: {
|
||||
goods_id: this.goodsId
|
||||
},
|
||||
success: res => {
|
||||
for (let i = 0; i < this.evaluateList.length; i++) {
|
||||
if (this.evaluateList[i].value == 0) {
|
||||
this.evaluateList[i].count = res.data.total;
|
||||
} else if (this.evaluateList[i].value == 1) {
|
||||
this.evaluateList[i].count = res.data.haoping;
|
||||
} else if (this.evaluateList[i].value == 2) {
|
||||
this.evaluateList[i].count = res.data.zhongping;
|
||||
} else if (this.evaluateList[i].value == 3) {
|
||||
this.evaluateList[i].count = res.data.chaping;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
getGoodsEvaluate(mescroll) {
|
||||
this.mescroll_type = mescroll;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodsevaluate/page',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size,
|
||||
goods_id: this.goodsId,
|
||||
explain_type: this.evaluateTab == 0 ? '' : this.evaluateTab
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
|
||||
for (var i = 0; i < newArr.length; i++) {
|
||||
if (newArr[i].images) newArr[i].images = newArr[i].images.split(',');
|
||||
if (newArr[i].again_images) newArr[i].again_images = newArr[i].again_images.split(',');
|
||||
if (newArr[i].is_anonymous == 1) newArr[i].member_name = newArr[i].member_name.replace(newArr[i].member_name.substring(1, newArr[i].member_name.length - 1), '***');
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
|
||||
this.list = this.list.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 预览评价图片
|
||||
previewEvaluate(index, img_index, field) {
|
||||
var paths = [];
|
||||
for (let i = 0; i < this.list[index][field].length; i++) {
|
||||
paths.push(this.$util.img(this.list[index][field][i]));
|
||||
}
|
||||
uni.previewImage({
|
||||
current: img_index,
|
||||
urls: paths
|
||||
});
|
||||
},
|
||||
|
||||
imageError(index) {
|
||||
this.list[index].member_headimg = this.$util.getDefaultImage().head;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
onEvaluateTab(value) {
|
||||
this.list = [];
|
||||
this.evaluateTab = value;
|
||||
this.mescroll_type.num = 1;
|
||||
this.mescroll_type.size = 10;
|
||||
let mescrolls = {
|
||||
num: 1,
|
||||
size: 10
|
||||
};
|
||||
this.getGoodsEvaluate(this.mescroll_type);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.goods-evaluate {
|
||||
.evaluate-tab {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
height: 100rpx;
|
||||
padding: 0 $margin-both;
|
||||
|
||||
view {
|
||||
background: #f0f0f0;
|
||||
color: #333;
|
||||
border-radius: 30rpx;
|
||||
margin-right: 20rpx;
|
||||
padding: 8rpx 30rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.active-tab {
|
||||
background-color: $base-color;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.evaluate-item {
|
||||
margin: $margin-updown $margin-both;
|
||||
padding: $margin-both;
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
|
||||
.evaluator {
|
||||
& > view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.evaluator-face {
|
||||
width: 79rpx;
|
||||
height: 79rpx;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.evaluator-info {
|
||||
width: 85%;
|
||||
margin-left: 13rpx;
|
||||
|
||||
.evaluator-name {
|
||||
color: #303133;
|
||||
font-size: $font-size-base;
|
||||
line-height: 1;
|
||||
width: 250rpx;
|
||||
}
|
||||
|
||||
.evaluator-time {
|
||||
font-size: $font-size-tag;
|
||||
// margin-top: 14rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
.evaluator-info-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.cont {
|
||||
text-align: justify;
|
||||
display: -webkit-box;
|
||||
word-break: break-all;
|
||||
font-size: $font-size-base;
|
||||
margin: 26rpx 0 0;
|
||||
color: #000000;
|
||||
line-height: 42rpx;
|
||||
}
|
||||
|
||||
.evaluate-img {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 19rpx;
|
||||
|
||||
.img-box {
|
||||
flex-shrink: 0;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
overflow: hidden;
|
||||
margin: 20rpx 23rpx 0 0;
|
||||
border-radius: 10rpx;
|
||||
|
||||
&:nth-child(4n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
&:nth-child(-n + 4) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: $font-size-tag;
|
||||
background: #f8f8f8;
|
||||
padding: 10rpx 20rpx;
|
||||
border-radius: 6rpx;
|
||||
margin-top: 20rpx;
|
||||
|
||||
text {
|
||||
line-height: 42rpx;
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
|
||||
.evaluation-reply {
|
||||
margin-top: 10rpx;
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
|
||||
.review-evaluation {
|
||||
margin-top: 29rpx;
|
||||
font-size: $font-size-base;
|
||||
line-height: 1;
|
||||
|
||||
.review-time {
|
||||
overflow: hidden;
|
||||
float: right;
|
||||
}
|
||||
|
||||
& + .cont {
|
||||
margin: 18rpx 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.shop-reply {
|
||||
font-size: $font-size-base;
|
||||
color: #000;
|
||||
line-height: 1;
|
||||
|
||||
& + .cont {
|
||||
margin-top: 10rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
.shop-reply-box {
|
||||
padding: 20rpx !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,43 +1,42 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="page">
|
||||
<view class="closeBox">
|
||||
<image :src="$util.img('public/uniapp/goods/not_exist.png')" mode="widthFix"></image>
|
||||
<text class="close-title">您查看的商品不存在,可能已下架或被删除</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
onShow() {},
|
||||
methods: {}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.page{
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
.closeBox {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 260rpx;
|
||||
}
|
||||
image {
|
||||
width: 400rpx;
|
||||
}
|
||||
.close-title {
|
||||
font-size: $font-size-base;
|
||||
color: $color-tip;
|
||||
margin: 55rpx;
|
||||
letter-spacing: 4rpx;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="page" :style="themeColor">
|
||||
<view class="closeBox">
|
||||
<image :src="$util.img('public/uniapp/goods/not_exist.png')" mode="widthFix"></image>
|
||||
<text class="close-title">您查看的商品不存在,可能已下架或被删除</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
onShow() {},
|
||||
methods: {}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.page{
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
.closeBox {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 260rpx;
|
||||
}
|
||||
image {
|
||||
width: 400rpx;
|
||||
}
|
||||
.close-title {
|
||||
font-size: $font-size-base;
|
||||
color: $color-tip;
|
||||
margin: 55rpx;
|
||||
letter-spacing: 4rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<view class="content">
|
||||
<view class="cate-search">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="page">
|
||||
<view class="page" :style="themeColor">
|
||||
<view class="help-title">{{ detail.title }}</view>
|
||||
<view class="help-content"><rich-text :nodes="content"></rich-text></view>
|
||||
<view class="help-meta">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="help">
|
||||
<view class="help" :style="themeColor">
|
||||
<block v-if="dataList.length">
|
||||
<view class="help-item" v-for="(item, index) in dataList" :key="index">
|
||||
<view :class="['item-title', item.child_list.length == 0 ? 'empty' : '']">{{ item.class_name }}</view>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="{ backgroundColor: bgColor, minHeight: openBottomNav ? 'calc(100vh - 55px)' : '' }" class="page-img">
|
||||
<view :style="themeColor + ';' + { backgroundColor: bgColor, minHeight: openBottomNav ? 'calc(100vh - 55px)' : '' }" class="page-img">
|
||||
<view class="page-header" v-if="diyData.global && diyData.global.navBarSwitch" :style="{ backgroundImage: bgImg }">
|
||||
<ns-navbar :title-color="textNavColor" :data="diyData.global" :scrollTop="scrollTop" :isBack="true"/>
|
||||
</view>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="find">
|
||||
<view class="find" :style="themeColor">
|
||||
<view class="iconfont icon-close" @click="navigateBack()"></view>
|
||||
<view class="header-wrap">
|
||||
<block v-if="stepShow == 0">
|
||||
|
||||
@@ -1,482 +1,498 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<scroll-view scroll-y="false" class="container">
|
||||
<view class="header-wrap" :style="{backgroundImage: 'url('+$util.img('public/uniapp/member/head.png')+')'}">
|
||||
<view class="t-b">
|
||||
<div v-html="$lang('welcomeText')"></div>
|
||||
<view :style="themeColor">
|
||||
<scroll-view scroll-y="false" class="container">
|
||||
<view class="header-wrap" :style="{ backgroundImage: 'url(' + $util.img('public/uniapp/member/head.png') + ')' }">
|
||||
<view class="t-b">
|
||||
<div v-html="$lang('welcomeText')"></div>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="body-wrap">
|
||||
<view class="form-wrap">
|
||||
<view class="input-wrap" v-show="loginMode == 'mobile'">
|
||||
<view class="content">
|
||||
<!-- <view class="area-code">+86</view> -->
|
||||
<input type="number" :placeholder="$lang('mobileInputPlaceholder')" placeholder-class="input-placeholder" class="input" maxlength="11" v-model="formData.mobile" />
|
||||
<view class="body-wrap">
|
||||
<view class="form-wrap">
|
||||
<view class="input-wrap" v-show="loginMode == 'mobile'">
|
||||
<view class="content">
|
||||
<!-- <view class="area-code">+86</view> -->
|
||||
<input type="number" :placeholder="$lang('mobileInputPlaceholder')"
|
||||
placeholder-class="input-placeholder" class="input" maxlength="11"
|
||||
v-model="formData.mobile" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="input-wrap" v-show="loginMode == 'account'">
|
||||
<view class="content">
|
||||
<input type="text" :placeholder="$lang('accountInputPlaceholder')" placeholder-class="input-placeholder" class="input" v-model="formData.account" />
|
||||
<view class="input-wrap" v-show="loginMode == 'account'">
|
||||
<view class="content">
|
||||
<input type="text" :placeholder="$lang('accountInputPlaceholder')"
|
||||
placeholder-class="input-placeholder" class="input" v-model="formData.account" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="input-wrap" v-show="loginMode == 'account'">
|
||||
<view class="content">
|
||||
<input type="password" :placeholder="$lang('passwordInputPlaceholder')" placeholder-class="input-placeholder" class="input" v-model="formData.password" />
|
||||
<view class="align-right" v-show="loginMode == 'account'">
|
||||
<text @click="forgetPassword">{{ $lang('forgetPasswordText') }}</text>
|
||||
<view class="input-wrap" v-show="loginMode == 'account'">
|
||||
<view class="content">
|
||||
<input type="password" :placeholder="$lang('passwordInputPlaceholder')"
|
||||
placeholder-class="input-placeholder" class="input" v-model="formData.password" />
|
||||
<view class="align-right" v-show="loginMode == 'account'">
|
||||
<text @click="forgetPassword">{{ $lang('forgetPasswordText') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="input-wrap" v-show="loginMode == 'mobile'">
|
||||
<view class="content">
|
||||
<input type="text" :placeholder="$lang('dynacodeInputPlaceholder')"
|
||||
placeholder-class="input-placeholder" class="input" v-model="formData.dynacode" />
|
||||
<view class="dynacode"
|
||||
:class="dynacodeData.seconds == 120 ? 'color-base-text' : 'color-tip'"
|
||||
@click="sendMobileCode">{{ dynacodeData.codeText }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="input-wrap" v-show="loginMode == 'mobile'">
|
||||
<view class="content">
|
||||
<input type="text" :placeholder="$lang('dynacodeInputPlaceholder')" placeholder-class="input-placeholder" class="input" v-model="formData.dynacode" />
|
||||
<view class="dynacode" :class="dynacodeData.seconds == 120 ? 'color-base-text' : 'color-tip'"
|
||||
@click="sendMobileCode">{{ dynacodeData.codeText }}</view>
|
||||
</view>
|
||||
|
||||
<view class="btn_view">
|
||||
<button type="primary" @click="login" class="login-btn color-base-border color-base-bg"
|
||||
style="background: #2796f2 !important;border: none;">{{ $lang('loginButtonText') }}</button>
|
||||
</view>
|
||||
<view class="regisiter-agreement"
|
||||
style="margin: 0 50rpx;padding-top: 40rpx;line-height: 1.5;display: flex;">
|
||||
<view style="" class="iconfont"
|
||||
:class="isAgree ? 'icon-fuxuankuang1 color-base-text' : 'icon-fuxuankuang2'"
|
||||
@click="isAgree = !isAgree"></view>
|
||||
<view style="text-align: left;margin-left: 10rpx;padding-top: 2rpx;">{{
|
||||
$lang('registerAgreementText') }} <text @click="tourl('/pages_tool/agreement/contenr?type=0')"
|
||||
style="color:#4395ff">{{ $lang('privacyPolicyText') }}</text> <text
|
||||
@click="tourl('/pages_tool/agreement/contenr?type=1')" style="color:#4395ff">{{
|
||||
$lang('userServiceAgreementText') }}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="btn_view">
|
||||
<button type="primary" @click="login" class="login-btn color-base-border color-base-bg" style="background: #2796f2 !important;border: none;">{{ $lang('loginButtonText') }}</button>
|
||||
</view>
|
||||
<view class="regisiter-agreement" style="margin: 0 50rpx;padding-top: 40rpx;line-height: 1.5;display: flex;">
|
||||
<view style="" class="iconfont" :class=" isAgree ? 'icon-fuxuankuang1 color-base-text' : 'icon-fuxuankuang2' " @click="isAgree = !isAgree"></view>
|
||||
<view style="text-align: left;margin-left: 10rpx;padding-top: 2rpx;">{{ $lang('registerAgreementText') }} <text @click="tourl('/pages_tool/agreement/contenr?type=0')" style="color:#4395ff">{{ $lang('privacyPolicyText') }}</text> <text @click="tourl('/pages_tool/agreement/contenr?type=1')" style="color:#4395ff">{{ $lang('userServiceAgreementText') }}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<register-reward ref="registerReward"></register-reward>
|
||||
</scroll-view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<register-reward ref="registerReward"></register-reward>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import validate from 'common/js/validate.js';
|
||||
import registerReward from '@/components/register-reward/register-reward.vue';
|
||||
import validate from 'common/js/validate.js';
|
||||
import registerReward from '@/components/register-reward/register-reward.vue';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isAgree: false,
|
||||
// loginMode: 'account',
|
||||
loginMode: 'mobile',
|
||||
formData: {
|
||||
mobile: '',
|
||||
account: '',
|
||||
password: '',
|
||||
vercode: '',
|
||||
dynacode: '',
|
||||
key: ''
|
||||
},
|
||||
captcha: {
|
||||
id: '',
|
||||
img: ''
|
||||
},
|
||||
isSub: false, // 提交防重复
|
||||
back: '', // 返回页
|
||||
redirect: 'redirectTo', // 跳转方式
|
||||
dynacodeData: {
|
||||
seconds: 120,
|
||||
timer: null,
|
||||
codeText: this.$lang('getDynacode'),
|
||||
isSend: false
|
||||
},
|
||||
registerConfig: {
|
||||
register: 'mobile',
|
||||
login: ''
|
||||
},
|
||||
captchaConfig: 0,
|
||||
authInfo: null
|
||||
};
|
||||
},
|
||||
components: {
|
||||
registerReward
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.back) this.back = option.back;
|
||||
this.getRegisterConfig();
|
||||
// this.getCaptchaConfig();
|
||||
this.authInfo = uni.getStorageSync('authInfo');
|
||||
},
|
||||
onShow() {},
|
||||
onReady() {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取验证码配置
|
||||
*/
|
||||
getCaptchaConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/config/getCaptchaConfig',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.captchaConfig = res.data.shop_reception_login;
|
||||
if (this.captchaConfig == 1) this.getCaptcha();
|
||||
}
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isAgree: false,
|
||||
// loginMode: 'account',
|
||||
loginMode: 'mobile',
|
||||
formData: {
|
||||
mobile: '',
|
||||
account: '',
|
||||
password: '',
|
||||
vercode: '',
|
||||
dynacode: '',
|
||||
key: ''
|
||||
},
|
||||
captcha: {
|
||||
id: '',
|
||||
img: ''
|
||||
},
|
||||
isSub: false, // 提交防重复
|
||||
back: '', // 返回页
|
||||
redirect: 'redirectTo', // 跳转方式
|
||||
dynacodeData: {
|
||||
seconds: 120,
|
||||
timer: null,
|
||||
codeText: this.$lang('getDynacode'),
|
||||
isSend: false
|
||||
},
|
||||
registerConfig: {
|
||||
register: 'mobile',
|
||||
login: ''
|
||||
},
|
||||
captchaConfig: 0,
|
||||
authInfo: null
|
||||
};
|
||||
},
|
||||
components: {
|
||||
registerReward
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.back) this.back = option.back;
|
||||
this.getRegisterConfig();
|
||||
// this.getCaptchaConfig();
|
||||
this.authInfo = uni.getStorageSync('authInfo');
|
||||
},
|
||||
onShow() { },
|
||||
onReady() {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取验证码配置
|
||||
*/
|
||||
getCaptchaConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/config/getCaptchaConfig',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.captchaConfig = res.data.shop_reception_login;
|
||||
if (this.captchaConfig == 1) this.getCaptcha();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取注册配置
|
||||
*/
|
||||
getRegisterConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/register/config',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
// this.registerConfig = res.data.value;
|
||||
// if (this.registerConfig.login.indexOf('mobile') != -1) this.loginMode = 'mobile';
|
||||
// else this.loginMode = 'account';
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 切换登录方式
|
||||
*/
|
||||
switchLoginMode() {
|
||||
this.loginMode = this.loginMode == 'mobile' ? 'account' : 'mobile';
|
||||
},
|
||||
/**
|
||||
* 获取验证码
|
||||
*/
|
||||
getCaptcha() {
|
||||
if (this.captchaConfig == 0) return;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/captcha/captcha',
|
||||
data: {
|
||||
captcha_id: this.captcha.id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.captcha = res.data;
|
||||
this.captcha.img = this.captcha.img.replace(/\r\n/g, '');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 去注册
|
||||
*/
|
||||
toRegister() {
|
||||
if (this.back) this.$util.redirectTo('/pages_tool/login/register', {
|
||||
back: encodeURIComponent(this.back)
|
||||
});
|
||||
else this.$util.redirectTo('/pages_tool/login/register');
|
||||
},
|
||||
/**
|
||||
* 忘记密码
|
||||
*/
|
||||
forgetPassword() {
|
||||
if (this.back) this.$util.redirectTo('/pages_tool/login/find', {
|
||||
back: encodeURIComponent(this.back)
|
||||
});
|
||||
else this.$util.redirectTo('/pages_tool/login/find');
|
||||
},
|
||||
tourl(url){
|
||||
this.$util.redirectTo(url);
|
||||
},
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
login() {
|
||||
if (!this.isAgree) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('agreeAgreementTip')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.loginMode == 'account') {
|
||||
var url = '/api/login/login';
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取注册配置
|
||||
*/
|
||||
getRegisterConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/register/config',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
// this.registerConfig = res.data.value;
|
||||
// if (this.registerConfig.login.indexOf('mobile') != -1) this.loginMode = 'mobile';
|
||||
// else this.loginMode = 'account';
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 切换登录方式
|
||||
*/
|
||||
switchLoginMode() {
|
||||
this.loginMode = this.loginMode == 'mobile' ? 'account' : 'mobile';
|
||||
},
|
||||
/**
|
||||
* 获取验证码
|
||||
*/
|
||||
getCaptcha() {
|
||||
if (this.captchaConfig == 0) return;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/captcha/captcha',
|
||||
data: {
|
||||
captcha_id: this.captcha.id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.captcha = res.data;
|
||||
this.captcha.img = this.captcha.img.replace(/\r\n/g, '');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 去注册
|
||||
*/
|
||||
toRegister() {
|
||||
if (this.back) this.$util.redirectTo('/pages_tool/login/register', {
|
||||
back: encodeURIComponent(this.back)
|
||||
});
|
||||
else this.$util.redirectTo('/pages_tool/login/register');
|
||||
},
|
||||
/**
|
||||
* 忘记密码
|
||||
*/
|
||||
forgetPassword() {
|
||||
if (this.back) this.$util.redirectTo('/pages_tool/login/find', {
|
||||
back: encodeURIComponent(this.back)
|
||||
});
|
||||
else this.$util.redirectTo('/pages_tool/login/find');
|
||||
},
|
||||
tourl(url) {
|
||||
this.$util.redirectTo(url);
|
||||
},
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
login() {
|
||||
if (!this.isAgree) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('agreeAgreementTip')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.loginMode == 'account') {
|
||||
var url = '/api/login/login';
|
||||
data = {
|
||||
username: this.formData.account,
|
||||
password: this.formData.password
|
||||
};
|
||||
} else {
|
||||
var url = '/api/login/mobile',
|
||||
data = {
|
||||
username: this.formData.account,
|
||||
password: this.formData.password
|
||||
mobile: this.formData.mobile,
|
||||
key: this.formData.key,
|
||||
code: this.formData.dynacode
|
||||
};
|
||||
} else {
|
||||
var url = '/api/login/mobile',
|
||||
data = {
|
||||
mobile: this.formData.mobile,
|
||||
key: this.formData.key,
|
||||
code: this.formData.dynacode
|
||||
};
|
||||
}
|
||||
if (this.captcha.id != '') {
|
||||
data.captcha_id = this.captcha.id;
|
||||
data.captcha_code = this.formData.vercode;
|
||||
}
|
||||
if (this.authInfo) Object.assign(data, this.authInfo);
|
||||
if (uni.getStorageSync('source_member')) data.source_member = uni.getStorageSync('source_member');
|
||||
}
|
||||
if (this.captcha.id != '') {
|
||||
data.captcha_id = this.captcha.id;
|
||||
data.captcha_code = this.formData.vercode;
|
||||
}
|
||||
if (this.authInfo) Object.assign(data, this.authInfo);
|
||||
if (uni.getStorageSync('source_member')) data.source_member = uni.getStorageSync('source_member');
|
||||
|
||||
if (this.verify(data)) {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
this.$api.sendRequest({
|
||||
url,
|
||||
data,
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
var can_receive_registergift = res.data.can_receive_registergift;
|
||||
this.$store.commit('setToken', res.data.token);
|
||||
this.$store.dispatch('getCartNumber');
|
||||
this.getMemberInfo(() => {
|
||||
if (can_receive_registergift == 1) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('loginSuccessTip')
|
||||
});
|
||||
let back = this.back ? this.back : '/pages/member/index';
|
||||
if(this.$refs.registerReward) this.$refs.registerReward.open(back);
|
||||
if (this.verify(data)) {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
this.$api.sendRequest({
|
||||
url,
|
||||
data,
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
var can_receive_registergift = res.data.can_receive_registergift;
|
||||
this.$store.commit('setToken', res.data.token);
|
||||
this.$store.dispatch('getCartNumber');
|
||||
this.getMemberInfo(() => {
|
||||
if (can_receive_registergift == 1) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('loginSuccessTip')
|
||||
});
|
||||
let back = this.back ? this.back : '/pages/member/index';
|
||||
if (this.$refs.registerReward) this.$refs.registerReward.open(back);
|
||||
} else {
|
||||
if (this.back != '') {
|
||||
this.$util.redirectTo(decodeURIComponent(this.back), {}, 'reLaunch');
|
||||
} else {
|
||||
if (this.back != '') {
|
||||
this.$util.redirectTo(decodeURIComponent(this.back), {}, 'reLaunch');
|
||||
} else {
|
||||
this.$util.redirectTo('/pages/member/index', {}, 'reLaunch');
|
||||
}
|
||||
this.$util.redirectTo('/pages/member/index', {}, 'reLaunch');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.isSub = false;
|
||||
this.getCaptcha();
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.isSub = false;
|
||||
this.getCaptcha();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 登录验证
|
||||
* @param {Object} data
|
||||
*/
|
||||
verify(data) {
|
||||
let rule = [];
|
||||
// 手机号验证
|
||||
if (this.loginMode == 'mobile') {
|
||||
rule = [{
|
||||
name: 'mobile',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('enterMobileTip')
|
||||
}, {
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: this.$lang('enterCorrectMobileTip')
|
||||
}];
|
||||
if (this.captchaConfig == 1) {
|
||||
if (this.captcha.id != '') rule.push({
|
||||
name: 'captcha_code',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('captchaPlaceholder')
|
||||
});
|
||||
}
|
||||
rule.push({
|
||||
name: 'code',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('dynacodePlaceholder')
|
||||
});
|
||||
}
|
||||
|
||||
// 账号验证
|
||||
if (this.loginMode == 'account') {
|
||||
rule = [{
|
||||
name: 'username',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('accountPlaceholder')
|
||||
},
|
||||
{
|
||||
name: 'password',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('passwordPlaceholder')
|
||||
}
|
||||
];
|
||||
if (this.captchaConfig == 1) {
|
||||
if (this.captcha.id != '') rule.push({
|
||||
name: 'captcha_code',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('captchaPlaceholder')
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var checkRes = validate.check(data, rule);
|
||||
if (checkRes) {
|
||||
return true;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: validate.error
|
||||
});
|
||||
return false;
|
||||
}
|
||||
},
|
||||
mobileAuthLogin(e) {
|
||||
if (e.detail.errMsg == 'getPhoneNumber:ok') {
|
||||
var data = {
|
||||
iv: e.detail.iv,
|
||||
encryptedData: e.detail.encryptedData
|
||||
};
|
||||
if (Object.keys(this.authInfo).length) {
|
||||
Object.assign(data, this.authInfo);
|
||||
if (this.authInfo.nickName) data.nickname = this.authInfo.nickName;
|
||||
if (this.authInfo.avatarUrl) data.headimg = this.authInfo.avatarUrl;
|
||||
}
|
||||
if (uni.getStorageSync('source_member')) data.source_member = uni.getStorageSync('source_member');
|
||||
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/api/tripartite/mobileauth',
|
||||
data,
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
var can_receive_registergift = res.data.can_receive_registergift;
|
||||
this.$store.commit('setToken', res.data.token);
|
||||
this.$store.dispatch('getCartNumber');
|
||||
this.getMemberInfo(() => {
|
||||
if (can_receive_registergift == 1) {
|
||||
let back = this.back ? this.back : '/pages/member/index';
|
||||
if(this.$refs.registerReward) this.$refs.registerReward.open(back);
|
||||
} else {
|
||||
if (this.back != '') {
|
||||
this.$util.redirectTo(decodeURIComponent(this.back), {}, this.redirect);
|
||||
} else {
|
||||
this.$util.redirectTo('/pages/member/index', {}, this.redirect);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
this.isSub = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
this.$util.showToast({
|
||||
title: this.$lang('requestFailTip')
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 发送手机动态码
|
||||
*/
|
||||
sendMobileCode() {
|
||||
if (this.dynacodeData.seconds != 120 || this.dynacodeData.isSend) return;
|
||||
var data = {
|
||||
mobile: this.formData.mobile,
|
||||
captcha_id: this.captcha.id,
|
||||
captcha_code: this.formData.vercode
|
||||
};
|
||||
var rule = [{
|
||||
name: 'mobile',
|
||||
checkType: 'required',
|
||||
errorMsg: '请输入手机号'
|
||||
}, {
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: '请输入正确的手机号'
|
||||
}];
|
||||
if (this.captchaConfig == 1) {
|
||||
rule.push({
|
||||
name: 'captcha_code',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('enterCaptchaTip')
|
||||
});
|
||||
}
|
||||
var checkRes = validate.check(data, rule);
|
||||
if (!checkRes) {
|
||||
this.$util.showToast({
|
||||
title: validate.error
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.dynacodeData.isSend = true;
|
||||
this.dynacodeData.timer = setInterval(() => {
|
||||
this.dynacodeData.seconds--;
|
||||
this.dynacodeData.codeText = this.dynacodeData.seconds + 's后可重新获取';
|
||||
}, 1000);
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/api/login/mobileCode',
|
||||
data: data,
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.formData.key = res.data.key;
|
||||
} else {
|
||||
this.refreshDynacodeData();
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.$util.showToast({
|
||||
title: 'request:fail'
|
||||
});
|
||||
this.refreshDynacodeData();
|
||||
}
|
||||
});
|
||||
},
|
||||
refreshDynacodeData() {
|
||||
this.getCaptcha();
|
||||
clearInterval(this.dynacodeData.timer);
|
||||
this.dynacodeData = {
|
||||
seconds: 120,
|
||||
timer: null,
|
||||
codeText: '获取动态码',
|
||||
isSend: false
|
||||
};
|
||||
},
|
||||
getMemberInfo(callback) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/info',
|
||||
success: (res) => {
|
||||
if (res.code >= 0) {
|
||||
// 登录成功,存储会员信息
|
||||
this.$store.commit('setMemberInfo', res.data);
|
||||
if (callback) callback();
|
||||
}
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
this.getCaptcha();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'dynacodeData.seconds': {
|
||||
handler(newValue, oldValue) {
|
||||
if (newValue == 0) {
|
||||
/**
|
||||
* 登录验证
|
||||
* @param {Object} data
|
||||
*/
|
||||
verify(data) {
|
||||
let rule = [];
|
||||
// 手机号验证
|
||||
if (this.loginMode == 'mobile') {
|
||||
rule = [{
|
||||
name: 'mobile',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('enterMobileTip')
|
||||
}, {
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: this.$lang('enterCorrectMobileTip')
|
||||
}];
|
||||
if (this.captchaConfig == 1) {
|
||||
if (this.captcha.id != '') rule.push({
|
||||
name: 'captcha_code',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('captchaPlaceholder')
|
||||
});
|
||||
}
|
||||
rule.push({
|
||||
name: 'code',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('dynacodePlaceholder')
|
||||
});
|
||||
}
|
||||
|
||||
// 账号验证
|
||||
if (this.loginMode == 'account') {
|
||||
rule = [{
|
||||
name: 'username',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('accountPlaceholder')
|
||||
},
|
||||
{
|
||||
name: 'password',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('passwordPlaceholder')
|
||||
}
|
||||
];
|
||||
if (this.captchaConfig == 1) {
|
||||
if (this.captcha.id != '') rule.push({
|
||||
name: 'captcha_code',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('captchaPlaceholder')
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var checkRes = validate.check(data, rule);
|
||||
if (checkRes) {
|
||||
return true;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: validate.error
|
||||
});
|
||||
return false;
|
||||
}
|
||||
},
|
||||
mobileAuthLogin(e) {
|
||||
if (e.detail.errMsg == 'getPhoneNumber:ok') {
|
||||
var data = {
|
||||
iv: e.detail.iv,
|
||||
encryptedData: e.detail.encryptedData
|
||||
};
|
||||
if (Object.keys(this.authInfo).length) {
|
||||
Object.assign(data, this.authInfo);
|
||||
if (this.authInfo.nickName) data.nickname = this.authInfo.nickName;
|
||||
if (this.authInfo.avatarUrl) data.headimg = this.authInfo.avatarUrl;
|
||||
}
|
||||
if (uni.getStorageSync('source_member')) data.source_member = uni.getStorageSync('source_member');
|
||||
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/api/tripartite/mobileauth',
|
||||
data,
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
var can_receive_registergift = res.data.can_receive_registergift;
|
||||
this.$store.commit('setToken', res.data.token);
|
||||
this.$store.dispatch('getCartNumber');
|
||||
this.getMemberInfo(() => {
|
||||
if (can_receive_registergift == 1) {
|
||||
let back = this.back ? this.back : '/pages/member/index';
|
||||
if (this.$refs.registerReward) this.$refs.registerReward.open(back);
|
||||
} else {
|
||||
if (this.back != '') {
|
||||
this.$util.redirectTo(decodeURIComponent(this.back), {}, this.redirect);
|
||||
} else {
|
||||
this.$util.redirectTo('/pages/member/index', {}, this.redirect);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
this.isSub = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
this.$util.showToast({
|
||||
title: this.$lang('requestFailTip')
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 发送手机动态码
|
||||
*/
|
||||
sendMobileCode() {
|
||||
if (this.dynacodeData.seconds != 120 || this.dynacodeData.isSend) return;
|
||||
var data = {
|
||||
mobile: this.formData.mobile,
|
||||
captcha_id: this.captcha.id,
|
||||
captcha_code: this.formData.vercode
|
||||
};
|
||||
var rule = [{
|
||||
name: 'mobile',
|
||||
checkType: 'required',
|
||||
errorMsg: '请输入手机号'
|
||||
}, {
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: '请输入正确的手机号'
|
||||
}];
|
||||
if (this.captchaConfig == 1) {
|
||||
rule.push({
|
||||
name: 'captcha_code',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('enterCaptchaTip')
|
||||
});
|
||||
}
|
||||
var checkRes = validate.check(data, rule);
|
||||
if (!checkRes) {
|
||||
this.$util.showToast({
|
||||
title: validate.error
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.dynacodeData.isSend = true;
|
||||
this.dynacodeData.timer = setInterval(() => {
|
||||
this.dynacodeData.seconds--;
|
||||
this.dynacodeData.codeText = this.dynacodeData.seconds + 's后可重新获取';
|
||||
}, 1000);
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/api/login/mobileCode',
|
||||
data: data,
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.formData.key = res.data.key;
|
||||
} else {
|
||||
this.refreshDynacodeData();
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
deep: true
|
||||
}
|
||||
fail: () => {
|
||||
this.$util.showToast({
|
||||
title: 'request:fail'
|
||||
});
|
||||
this.refreshDynacodeData();
|
||||
}
|
||||
});
|
||||
},
|
||||
refreshDynacodeData() {
|
||||
this.getCaptcha();
|
||||
clearInterval(this.dynacodeData.timer);
|
||||
this.dynacodeData = {
|
||||
seconds: 120,
|
||||
timer: null,
|
||||
codeText: '获取动态码',
|
||||
isSend: false
|
||||
};
|
||||
},
|
||||
getMemberInfo(callback) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/info',
|
||||
success: (res) => {
|
||||
if (res.code >= 0) {
|
||||
// 登录成功,存储会员信息
|
||||
this.$store.commit('setMemberInfo', res.data);
|
||||
if (callback) callback();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'dynacodeData.seconds': {
|
||||
handler(newValue, oldValue) {
|
||||
if (newValue == 0) {
|
||||
this.refreshDynacodeData();
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
deep: true
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/common.scss';
|
||||
.color-base-text{
|
||||
color:#2796f2 !important
|
||||
}
|
||||
@import './public/css/common.scss';
|
||||
|
||||
.color-base-text {
|
||||
color: #2796f2 !important
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/deep/ .reward-popup .uni-popup__wrapper-box {
|
||||
background: none !important;
|
||||
max-width: unset !important;
|
||||
max-height: unset !important;
|
||||
overflow: unset !important;
|
||||
}
|
||||
/deep/ .reward-popup .uni-popup__wrapper-box {
|
||||
background: none !important;
|
||||
max-width: unset !important;
|
||||
max-height: unset !important;
|
||||
overflow: unset !important;
|
||||
}
|
||||
|
||||
/deep/ uni-toast .uni-simple-toast__text {
|
||||
background: red !important;
|
||||
}
|
||||
/deep/ uni-toast .uni-simple-toast__text {
|
||||
background: red !important;
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni ref="mescroll" @getData="getData" v-if="storeToken">
|
||||
<block slot="list">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="account-list-content">
|
||||
<view class="account-list-content" :style="themeColor">
|
||||
<view class="edit-item">
|
||||
<text class="tit">{{ $lang('name') }}</text>
|
||||
<input class="desc uni-input" type="text" maxlength="30" placeholder="请输入真实姓名" name="name" v-model="formData.realname" />
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni ref="mescroll" @getData="getListData" v-if="storeToken">
|
||||
<block slot="list">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="address-edit-content">
|
||||
<view class="address-edit-content" :style="themeColor">
|
||||
<view class="edit-wrap">
|
||||
<view class="tip">地址信息</view>
|
||||
<view class="edit-item">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="container">
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="bank-account-wrap" @click="goAccount()">
|
||||
<view class="tx-wrap" v-if="bankAccountInfo.withdraw_type">
|
||||
<text class="tx-to">提现到</text>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="container">
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="assets-wrap">
|
||||
<view class="assets-block">
|
||||
<view class="assets-tips"><text>风险提示:确认申请后您的资产将被清空且不可找回!</text></view>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="balance">
|
||||
<view class="balance" :style="themeColor">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="custom-navbar" :style="{
|
||||
'padding-top': menuButtonBounding.top + 'px',
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<!-- <scroll-view id="tab-bar" class="order-nav" :scroll-x="true" :show-scrollbar="false" :scroll-into-view="scrollInto">
|
||||
<view v-for="(statusItem, statusIndex) in statusList" :key="statusIndex" class="uni-tab-item" :id="statusItem.id" :data-current="statusIndex" @click="ontabtap">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="container">
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="agreement-box">
|
||||
<view class="agreement-intro">
|
||||
<view class="align-center agreement-title">{{ agreement.title }}</view>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="container">
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="cancel-wrap">
|
||||
<view class="cancel-img"><image :src="$util.img('public/uniapp/member/refuse.png')"></image></view>
|
||||
<view class="cancel-title">您的申请已拒绝</view>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="container">
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="cancelstatus-wrap">
|
||||
<view class="cancelstatus-block">
|
||||
<view class="cancelstatus-box">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="container">
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="cancel-wrap">
|
||||
<view class="cancel-img">
|
||||
<image :src="$util.img('public/uniapp/member/success.png')"></image>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="member-level">
|
||||
<view class="member-level" :style="themeColor">
|
||||
<view class="level-top">
|
||||
<image :src="$util.img('public/uniapp/level/card-top-bg.png')"></image>
|
||||
</view>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="page">
|
||||
<view class="page" :style="themeColor">
|
||||
<view class="agreement-title">{{ title }}</view>
|
||||
<view class="agreement-content"><rich-text :nodes="content"></rich-text></view>
|
||||
</view>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="member-level">
|
||||
<view class="member-level" :style="themeColor">
|
||||
<block v-if="levelList.length">
|
||||
<view class="level-top">
|
||||
<image :src="$util.img('public/uniapp/level/card-top-bg.png')"></image>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni ref="mescroll" @getData="getData" class="member-point" :size="8" @listenRefresh="listenRefresh" v-if="storeToken">
|
||||
<view class="goods_list" slot="list">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="contact">
|
||||
<view class="contact" :style="themeColor">
|
||||
<image :src="$util.img('public/uniapp/member/contact_service.png')" mode="widthFix"></image>
|
||||
<!--<ns-contact><button type="primary">联系客服</button></ns-contact>-->
|
||||
</view>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :class="isIphoneX ? 'iphone-x' : ''">
|
||||
<view :style="themeColor" :class="isIphoneX ? 'iphone-x' : ''">
|
||||
<view class="cf-container color-line-border" v-if="storeToken">
|
||||
<view class="tab">
|
||||
<view @click="changeState(1)"><text :class="state == 1 ? 'color-base-text active color-base-border-bottom' : ''">未使用</text></view>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="container">
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="head-wrap" v-if="storeToken">
|
||||
<text @click="manageFootprint">{{ manage ? '完成' : '管理' }}</text>
|
||||
</view>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="{ backgroundColor: bgColor, minHeight: openBottomNav ? 'calc(100vh - 55px)' : '' }" class="page-img">
|
||||
<view :style="themeColor + ';' + { backgroundColor: bgColor, minHeight: openBottomNav ? 'calc(100vh - 55px)' : '' }" class="page-img">
|
||||
<view class="page-header" v-if="diyData.global && diyData.global.navBarSwitch"
|
||||
:style="{ backgroundImage: bgImg }">
|
||||
<ns-navbar :title-color="textNavColor" :data="diyData.global" :scrollTop="scrollTop" :isBack="true" />
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<view v-if="indent == 'all' && memberInfo" class="info-wrap">
|
||||
<!-- 头像@click="headImage" -->
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<template v-if="memberInfo">
|
||||
<!-- 修改用户名 -->
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<view v-if="info" style="background-color: #fff;">
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="member-level">
|
||||
<view :style="themeColor" class="member-level">
|
||||
<view class="level-top">
|
||||
<image :src="$util.img('public/uniapp/level/level-top-bg.png')"></image>
|
||||
</view>
|
||||
|
||||
@@ -1,275 +1,274 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="member-level">
|
||||
<view class="grow-explain">
|
||||
<view class="explain-title">
|
||||
<image :src="$util.img('public/uniapp/level/growth_that_left.png')" mode="aspectFit"></image>
|
||||
成长值说明
|
||||
<image :src="$util.img('public/uniapp/level/growth_that_right.png')" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="explain-table">
|
||||
<view class="explain-tr">
|
||||
<text class="explain-th">等级</text>
|
||||
<text class="explain-th">成长值</text>
|
||||
</view>
|
||||
<view class="explain-tr" v-for="(item, index) in levelList" :key="index">
|
||||
<text class="explain-td">{{ item.level_name }}</text>
|
||||
<text class="explain-td">{{ item.growth }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="grow-value">
|
||||
<view class="title">
|
||||
<image :src="$util.img('public/uniapp/level/explain.png')" mode="aspectFit"></image>
|
||||
<text>什么是成长值</text>
|
||||
</view>
|
||||
<view class="content color-tip">成长值是消费者在店铺成为会员后,通过消费计算出来的值。成长值决定会员等级,会员等级越高,所享受的会员权益和会员礼包就越多。</view>
|
||||
</view>
|
||||
<view class="acquisition-grow">
|
||||
<view class="title">
|
||||
<image :src="$util.img('public/uniapp/level/explain.png')" mode="aspectFit"></image>
|
||||
<text>如何获得成长值</text>
|
||||
</view>
|
||||
<view class="content color-tip">
|
||||
<text>1、注册会员送x成长值。</text>
|
||||
<text>2、会员充值到余额送x成长值。</text>
|
||||
<text>3、会员签到送x成长值。</text>
|
||||
<text>4、会员消费x元,交易完成即可获得x个成长值。</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import nsProgress from '@/pages_tool/components/ns-progress/ns-progress.vue';
|
||||
import toTop from '@/components/toTop/toTop.vue';
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
nsProgress,
|
||||
toTop
|
||||
},
|
||||
mixins: [scroll],
|
||||
data() {
|
||||
return {
|
||||
curIndex: 0,
|
||||
descIndex: 0,
|
||||
isDescAnimating: false,
|
||||
scaleX: (634 / 540).toFixed(4),
|
||||
scaleY: (378 / 330).toFixed(4),
|
||||
swiperConfig: {
|
||||
//type==1时的默认参数
|
||||
indicatorDots: false,
|
||||
indicatorColor: 'rgba(255, 255, 255, .4)',
|
||||
indicatorActiveColor: 'rgba(255, 255, 255, 1)',
|
||||
interval: 3000,
|
||||
duration: 300,
|
||||
circular: false,
|
||||
previousMargin: '58rpx',
|
||||
nextMargin: '58rpx'
|
||||
},
|
||||
levelList: [{
|
||||
needGrowth: 0,
|
||||
growth: 0
|
||||
}],
|
||||
levelId: 0,
|
||||
growth: 0,
|
||||
|
||||
nowIndex: 0, //我当前所在等级的index
|
||||
rule: [] //成长值规则
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
listLen() {
|
||||
return this.levelList.length;
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
//会员等级
|
||||
this.getLevelList();
|
||||
this.getLevelRule();
|
||||
},
|
||||
onShow() {},
|
||||
filters: {
|
||||
rate(index, list, growth) {
|
||||
let nowGrowth = Number(growth);
|
||||
let minGrouth = Number(list[index].growth);
|
||||
if (index == list.length - 1) {
|
||||
return nowGrowth > minGrouth ? 100 : 0;
|
||||
} else {
|
||||
let maxGrouth = Number(list[index + 1].growth);
|
||||
let num2 = nowGrowth - minGrouth;
|
||||
let num1 = maxGrouth - minGrouth;
|
||||
let num = Math.floor((num2 / num1) * 100);
|
||||
return num > 100 ? 100 : num;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
swiperChange(e) {
|
||||
let that = this;
|
||||
this.curIndex = e.detail.current;
|
||||
this.isDescAnimating = true;
|
||||
let timer = setTimeout(function() {
|
||||
that.descIndex = e.detail.current;
|
||||
clearTimeout(timer);
|
||||
}, 150);
|
||||
},
|
||||
animationfinish(e) {
|
||||
this.isDescAnimating = false;
|
||||
},
|
||||
getBannerDetail(index) {
|
||||
uni.showLoading({
|
||||
title: '将前往详情页面',
|
||||
duration: 2000,
|
||||
mask: true
|
||||
});
|
||||
},
|
||||
getLevelList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberlevel/lists',
|
||||
success: res => {
|
||||
if (res.data && res.code == 0) {
|
||||
this.levelList = res.data;
|
||||
this.levelId = this.memberInfo.member_level;
|
||||
this.growth = this.memberInfo.growth;
|
||||
for (let i = 0; i < this.levelList.length; i++) {
|
||||
if (this.levelList[i].level_id == this.levelId) {
|
||||
this.curIndex = i;
|
||||
this.descIndex = i;
|
||||
this.nowIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.levelList.forEach((v, i) => {
|
||||
let rate = 0;
|
||||
if (i != this.levelList.length - 1) {
|
||||
v.needGrowth = Number(this.levelList[i + 1].growth) - Number(this.growth); //距离下一阶段需要多少成长值
|
||||
|
||||
if (v.needGrowth <= 0) {
|
||||
rate = 100;
|
||||
} else {
|
||||
rate = (this.growth / this.levelList[i + 1].growth).toFixed(2) * 100;
|
||||
}
|
||||
} else {
|
||||
v.needGrowth = Number(this.levelList[i].growth) - Number(this.growth); //距离下一阶段需要多少成长值
|
||||
if (v.needGrowth <= 0) {
|
||||
rate = 100;
|
||||
} else {
|
||||
rate = (this.growth / this.levelList[i].growth).toFixed(2) * 100;
|
||||
}
|
||||
}
|
||||
v.rate = rate;
|
||||
});
|
||||
|
||||
this.levelList.forEach(v => {
|
||||
if (v.consume_discount) {
|
||||
v.consume_discount = (v.consume_discount / 10).toFixed(2);
|
||||
}
|
||||
});
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
getLevelRule() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/accountrule',
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data && res.data.growth) {
|
||||
this.rule = res.data.growth;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.grow-explain {
|
||||
padding: 30rpx;
|
||||
margin-top: 30rpx;
|
||||
|
||||
.explain-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
line-height: 1;
|
||||
|
||||
image {
|
||||
margin: 0 20rpx;
|
||||
width: 54rpx;
|
||||
height: 18rpx;
|
||||
}
|
||||
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.explain-tr {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.explain-th {
|
||||
padding: 10rpx 30rpx;
|
||||
|
||||
&~.explain-th {
|
||||
border-left: 4rpx solid #fff;
|
||||
}
|
||||
|
||||
flex: 1;
|
||||
background-color: #f6f1e4;
|
||||
}
|
||||
|
||||
.explain-td {
|
||||
padding: 10rpx 30rpx;
|
||||
|
||||
&~.explain-td {
|
||||
border-left: 4rpx solid #fff;
|
||||
}
|
||||
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
flex: 1;
|
||||
background-color: #fcfbf7;
|
||||
}
|
||||
}
|
||||
|
||||
.grow-value,
|
||||
.acquisition-grow {
|
||||
padding: 0 30rpx 30rpx;
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
image {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 24rpx;
|
||||
margin-left: 40rpx;
|
||||
|
||||
text {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor" class="member-level">
|
||||
<view class="grow-explain">
|
||||
<view class="explain-title">
|
||||
<image :src="$util.img('public/uniapp/level/growth_that_left.png')" mode="aspectFit"></image>
|
||||
成长值说明
|
||||
<image :src="$util.img('public/uniapp/level/growth_that_right.png')" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="explain-table">
|
||||
<view class="explain-tr">
|
||||
<text class="explain-th">等级</text>
|
||||
<text class="explain-th">成长值</text>
|
||||
</view>
|
||||
<view class="explain-tr" v-for="(item, index) in levelList" :key="index">
|
||||
<text class="explain-td">{{ item.level_name }}</text>
|
||||
<text class="explain-td">{{ item.growth }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="grow-value">
|
||||
<view class="title">
|
||||
<image :src="$util.img('public/uniapp/level/explain.png')" mode="aspectFit"></image>
|
||||
<text>什么是成长值</text>
|
||||
</view>
|
||||
<view class="content color-tip">成长值是消费者在店铺成为会员后,通过消费计算出来的值。成长值决定会员等级,会员等级越高,所享受的会员权益和会员礼包就越多。</view>
|
||||
</view>
|
||||
<view class="acquisition-grow">
|
||||
<view class="title">
|
||||
<image :src="$util.img('public/uniapp/level/explain.png')" mode="aspectFit"></image>
|
||||
<text>如何获得成长值</text>
|
||||
</view>
|
||||
<view class="content color-tip">
|
||||
<text>1、注册会员送x成长值。</text>
|
||||
<text>2、会员充值到余额送x成长值。</text>
|
||||
<text>3、会员签到送x成长值。</text>
|
||||
<text>4、会员消费x元,交易完成即可获得x个成长值。</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import nsProgress from '@/pages_tool/components/ns-progress/ns-progress.vue';
|
||||
import toTop from '@/components/toTop/toTop.vue';
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
nsProgress,
|
||||
toTop
|
||||
},
|
||||
mixins: [scroll],
|
||||
data() {
|
||||
return {
|
||||
curIndex: 0,
|
||||
descIndex: 0,
|
||||
isDescAnimating: false,
|
||||
scaleX: (634 / 540).toFixed(4),
|
||||
scaleY: (378 / 330).toFixed(4),
|
||||
swiperConfig: {
|
||||
//type==1时的默认参数
|
||||
indicatorDots: false,
|
||||
indicatorColor: 'rgba(255, 255, 255, .4)',
|
||||
indicatorActiveColor: 'rgba(255, 255, 255, 1)',
|
||||
interval: 3000,
|
||||
duration: 300,
|
||||
circular: false,
|
||||
previousMargin: '58rpx',
|
||||
nextMargin: '58rpx'
|
||||
},
|
||||
levelList: [{
|
||||
needGrowth: 0,
|
||||
growth: 0
|
||||
}],
|
||||
levelId: 0,
|
||||
growth: 0,
|
||||
|
||||
nowIndex: 0, //我当前所在等级的index
|
||||
rule: [] //成长值规则
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
listLen() {
|
||||
return this.levelList.length;
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
//会员等级
|
||||
this.getLevelList();
|
||||
this.getLevelRule();
|
||||
},
|
||||
onShow() {},
|
||||
filters: {
|
||||
rate(index, list, growth) {
|
||||
let nowGrowth = Number(growth);
|
||||
let minGrouth = Number(list[index].growth);
|
||||
if (index == list.length - 1) {
|
||||
return nowGrowth > minGrouth ? 100 : 0;
|
||||
} else {
|
||||
let maxGrouth = Number(list[index + 1].growth);
|
||||
let num2 = nowGrowth - minGrouth;
|
||||
let num1 = maxGrouth - minGrouth;
|
||||
let num = Math.floor((num2 / num1) * 100);
|
||||
return num > 100 ? 100 : num;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
swiperChange(e) {
|
||||
let that = this;
|
||||
this.curIndex = e.detail.current;
|
||||
this.isDescAnimating = true;
|
||||
let timer = setTimeout(function() {
|
||||
that.descIndex = e.detail.current;
|
||||
clearTimeout(timer);
|
||||
}, 150);
|
||||
},
|
||||
animationfinish(e) {
|
||||
this.isDescAnimating = false;
|
||||
},
|
||||
getBannerDetail(index) {
|
||||
uni.showLoading({
|
||||
title: '将前往详情页面',
|
||||
duration: 2000,
|
||||
mask: true
|
||||
});
|
||||
},
|
||||
getLevelList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberlevel/lists',
|
||||
success: res => {
|
||||
if (res.data && res.code == 0) {
|
||||
this.levelList = res.data;
|
||||
this.levelId = this.memberInfo.member_level;
|
||||
this.growth = this.memberInfo.growth;
|
||||
for (let i = 0; i < this.levelList.length; i++) {
|
||||
if (this.levelList[i].level_id == this.levelId) {
|
||||
this.curIndex = i;
|
||||
this.descIndex = i;
|
||||
this.nowIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.levelList.forEach((v, i) => {
|
||||
let rate = 0;
|
||||
if (i != this.levelList.length - 1) {
|
||||
v.needGrowth = Number(this.levelList[i + 1].growth) - Number(this.growth); //距离下一阶段需要多少成长值
|
||||
|
||||
if (v.needGrowth <= 0) {
|
||||
rate = 100;
|
||||
} else {
|
||||
rate = (this.growth / this.levelList[i + 1].growth).toFixed(2) * 100;
|
||||
}
|
||||
} else {
|
||||
v.needGrowth = Number(this.levelList[i].growth) - Number(this.growth); //距离下一阶段需要多少成长值
|
||||
if (v.needGrowth <= 0) {
|
||||
rate = 100;
|
||||
} else {
|
||||
rate = (this.growth / this.levelList[i].growth).toFixed(2) * 100;
|
||||
}
|
||||
}
|
||||
v.rate = rate;
|
||||
});
|
||||
|
||||
this.levelList.forEach(v => {
|
||||
if (v.consume_discount) {
|
||||
v.consume_discount = (v.consume_discount / 10).toFixed(2);
|
||||
}
|
||||
});
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
getLevelRule() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/accountrule',
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data && res.data.growth) {
|
||||
this.rule = res.data.growth;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.grow-explain {
|
||||
padding: 30rpx;
|
||||
margin-top: 30rpx;
|
||||
|
||||
.explain-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
line-height: 1;
|
||||
|
||||
image {
|
||||
margin: 0 20rpx;
|
||||
width: 54rpx;
|
||||
height: 18rpx;
|
||||
}
|
||||
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.explain-tr {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.explain-th {
|
||||
padding: 10rpx 30rpx;
|
||||
|
||||
&~.explain-th {
|
||||
border-left: 4rpx solid #fff;
|
||||
}
|
||||
|
||||
flex: 1;
|
||||
background-color: #f6f1e4;
|
||||
}
|
||||
|
||||
.explain-td {
|
||||
padding: 10rpx 30rpx;
|
||||
|
||||
&~.explain-td {
|
||||
border-left: 4rpx solid #fff;
|
||||
}
|
||||
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
flex: 1;
|
||||
background-color: #fcfbf7;
|
||||
}
|
||||
}
|
||||
|
||||
.grow-value,
|
||||
.acquisition-grow {
|
||||
padding: 0 30rpx 30rpx;
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
image {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 24rpx;
|
||||
margin-left: 40rpx;
|
||||
|
||||
text {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="nc-modify-content">
|
||||
<view :style="themeColor" class="nc-modify-content">
|
||||
<view class="modify">
|
||||
<view>
|
||||
<image v-if="newImg == ''" :src="memberImg ? $util.img(memberImg) : $util.getDefaultImage().head" @error="memberImg = $util.getDefaultImage().head" mode="aspectFill"/>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="container">
|
||||
<view :style="themeColor" class="container">
|
||||
<view class="tips" v-if="step != 0">请输入6位支付密码,建议不要使用重复或连续数字</view>
|
||||
<view class="tips" v-else>验证码已发送至{{ memberInfo.mobile | mobile }}请在下方输入4位数字验证码</view>
|
||||
<view class="password-wrap">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="point">
|
||||
<view :style="themeColor" class="point">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="custom-navbar" :style="{
|
||||
'padding-top': menuButtonBounding.top + 'px',
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<!-- <view class="tab color-bg">
|
||||
<view class="tab-left">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni @getData="getData" class="member-point">
|
||||
<view slot="list">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<view class="money-wrap">
|
||||
<text>-{{ detail.apply_money }}</text>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="page">
|
||||
<view :style="themeColor" class="page">
|
||||
<view class="notice-title">{{ detail.title }}</view>
|
||||
<view class="notice-meta">
|
||||
<text class="notice-time">发表时间: {{ $util.timeStampTurnTime(detail.create_time) }}</text>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni @getData="getData" ref="mescroll">
|
||||
<block slot="list">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="activist-container">
|
||||
<view :style="themeColor" class="activist-container">
|
||||
<mescroll-uni ref="mescroll" @getData="getListData">
|
||||
<block slot="list">
|
||||
<view class="container">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<view>
|
||||
<view class="page">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<scroll-view class="order-nav" :scroll-x="true" :show-scrollbar="false">
|
||||
<view v-for="(packageItem, packageIndex) in packageList" :key="packageIndex" class="uni-tab-item" @click="ontabtap(packageIndex)">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<view>
|
||||
<scroll-view scroll-y="true" class="refund-container">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<view>
|
||||
<scroll-view scroll-y="true" class="refund-container">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<scroll-view scroll-y="true" class="detail-container" :class="{ 'safe-area': isIphoneX }" v-if="detail">
|
||||
<view v-show="action == ''">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="goods-select">
|
||||
<view class="goods-select" :style="themeColor">
|
||||
<view class="top">
|
||||
共<text class="color-base-text">{{refund_data.length}}</text>件商品
|
||||
</view>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<view>
|
||||
<view class="refund-option">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="cashier">
|
||||
<view class="cashier" :style="themeColor">
|
||||
<block v-if="payInfo">
|
||||
<block v-if="payInfo.pay_status == 0">
|
||||
<text class="content">{{ payInfo.pay_body }}</text>
|
||||
@@ -31,11 +30,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Weixin } from 'common/js/wx-jssdk.js';
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
|
||||
|
||||
export default {
|
||||
import { Weixin } from 'common/js/wx-jssdk.js';
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
|
||||
|
||||
export default {
|
||||
components: { nsLogin, nsEmpty },
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<scroll-view scroll-y="true" class="pay-container">
|
||||
<view class="payment-amount">
|
||||
<text class="amount-tit">{{ $lang('paymentAmount') }}</text>
|
||||
<view class="amount-num">
|
||||
{{ $lang('common.currencySymbol') }}
|
||||
<text>{{ payInfo.pay_money }}</text>
|
||||
<view :style="themeColor">
|
||||
<scroll-view scroll-y="true" class="pay-container">
|
||||
<view class="payment-amount">
|
||||
<text class="amount-tit">{{ $lang('paymentAmount') }}</text>
|
||||
<view class="amount-num">
|
||||
{{ $lang('common.currencySymbol') }}
|
||||
<text>{{ payInfo.pay_money }}</text>
|
||||
</view>
|
||||
<view class="payment-name">{{ payInfo.pay_body }}</view>
|
||||
</view>
|
||||
<view class="payment-name">{{ payInfo.pay_body }}</view>
|
||||
</view>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
</scroll-view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
@@ -71,38 +72,45 @@ export default {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
@mixin flex-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@mixin flex-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.payment-amount {
|
||||
@include flex-column;
|
||||
margin: $margin-updown $margin-both;
|
||||
border-radius: 8rpx;
|
||||
padding: 20rpx 0 58rpx 0;
|
||||
background-color: #fff;
|
||||
|
||||
.amount-tit {
|
||||
font-size: $font-size-base;
|
||||
color: #838383;
|
||||
line-height: 1;
|
||||
margin-top: 44rpx;
|
||||
}
|
||||
|
||||
.amount-num {
|
||||
color: #000;
|
||||
margin-top: 36rpx;
|
||||
line-height: 1;
|
||||
|
||||
text {
|
||||
font-size: $font-size-toolbar;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
.amount-desc {
|
||||
font-size: $font-size-tag;
|
||||
color: #838383;
|
||||
@@ -111,6 +119,7 @@ export default {
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
|
||||
text {
|
||||
width: 100%;
|
||||
display: block;
|
||||
@@ -119,6 +128,7 @@ export default {
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.payment-name {
|
||||
width: 90%;
|
||||
overflow: hidden;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="container">
|
||||
<view class="container" :style="themeColor">
|
||||
<template v-if="payInfo.pay_status != undefined">
|
||||
<view class="result-box">
|
||||
<template v-if="payInfo.pay_status">
|
||||
|
||||
@@ -1,94 +1,93 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="launch-mask" v-if="show == true">
|
||||
<view class="mask-img">
|
||||
<image :src="$util.img('public/uniapp/pay/invite_friends_share.png')" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="mask-word">点击右上角跳转到浏览器打开</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'wx_pay',
|
||||
data() {
|
||||
return {
|
||||
show : true,
|
||||
wx_alipay : "",
|
||||
out_trade_no : ""
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.wx_alipay = options.wx_alipay || '';
|
||||
this.out_trade_no = options.out_trade_no || '';
|
||||
if(!this.$util.isWeiXin() && this.wx_alipay){
|
||||
this.show = false;
|
||||
location.href = this.wx_alipay;
|
||||
}
|
||||
this.checkPayStatus();
|
||||
},
|
||||
methods: {
|
||||
getPayInfo(out_trade_no) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/pay/info',
|
||||
data: {
|
||||
out_trade_no
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.checkPayStatus();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
checkPayStatus() {
|
||||
var that = this;
|
||||
var timer = setInterval(() => {
|
||||
that.$api.sendRequest({
|
||||
url: '/api/pay/status',
|
||||
data: { out_trade_no: that.out_trade_no },
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data.pay_status == 2) {
|
||||
clearInterval(timer);
|
||||
that.$util.redirectTo('/pages_tool/pay/result', { code: that.out_trade_no }, '', 'redirectTo');
|
||||
}
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.launch-mask{
|
||||
position:fixed;
|
||||
top:0px;
|
||||
left: 0px;
|
||||
width:100%;
|
||||
height: 100%;
|
||||
background:rgba(0,0,0,0.8);
|
||||
.mask-img{
|
||||
text-align: right;
|
||||
margin:10% 10px 10px 30px;
|
||||
image{
|
||||
width: 50px;
|
||||
height:117px;
|
||||
margin-right:9%
|
||||
}
|
||||
}
|
||||
.mask-word{
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
text{
|
||||
color:#FF0036 !important
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="launch-mask" v-if="show == true" :style="themeColor">
|
||||
<view class="mask-img">
|
||||
<image :src="$util.img('public/uniapp/pay/invite_friends_share.png')" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="mask-word">点击右上角跳转到浏览器打开</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'wx_pay',
|
||||
data() {
|
||||
return {
|
||||
show : true,
|
||||
wx_alipay : "",
|
||||
out_trade_no : ""
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.wx_alipay = options.wx_alipay || '';
|
||||
this.out_trade_no = options.out_trade_no || '';
|
||||
if(!this.$util.isWeiXin() && this.wx_alipay){
|
||||
this.show = false;
|
||||
location.href = this.wx_alipay;
|
||||
}
|
||||
this.checkPayStatus();
|
||||
},
|
||||
methods: {
|
||||
getPayInfo(out_trade_no) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/pay/info',
|
||||
data: {
|
||||
out_trade_no
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.checkPayStatus();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
checkPayStatus() {
|
||||
var that = this;
|
||||
var timer = setInterval(() => {
|
||||
that.$api.sendRequest({
|
||||
url: '/api/pay/status',
|
||||
data: { out_trade_no: that.out_trade_no },
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data.pay_status == 2) {
|
||||
clearInterval(timer);
|
||||
that.$util.redirectTo('/pages_tool/pay/result', { code: that.out_trade_no }, '', 'redirectTo');
|
||||
}
|
||||
} else {
|
||||
clearInterval(timer);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.launch-mask{
|
||||
position:fixed;
|
||||
top:0px;
|
||||
left: 0px;
|
||||
width:100%;
|
||||
height: 100%;
|
||||
background:rgba(0,0,0,0.8);
|
||||
.mask-img{
|
||||
text-align: right;
|
||||
margin:10% 10px 10px 30px;
|
||||
image{
|
||||
width: 50px;
|
||||
height:117px;
|
||||
margin-right:9%
|
||||
}
|
||||
}
|
||||
.mask-word{
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
text{
|
||||
color:#FF0036 !important
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="page">
|
||||
<view class="page" :style="themeColor">
|
||||
|
||||
<view>
|
||||
<!-- <view class="recharge-title">充值</view>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="order-container">
|
||||
<view class="order-container" :style="themeColor">
|
||||
<mescroll-uni ref="mescroll" @getData="getListData">
|
||||
<block slot="list">
|
||||
<block v-if="orderList.length > 0">
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view :style="themeColor">
|
||||
<view class="closeBox">
|
||||
<image :src="$util.img('public/uniapp/store/storeclose.png')" mode="widthFix"></image>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user