Commit 44ebb1a8 authored by 黄媛媛's avatar 黄媛媛

微店页面

parent b422bbfb
......@@ -33,6 +33,7 @@
{
"path": "pages/webbox/webbox"
}
],
"subPackages": [{
"root": "pages/goods",
......@@ -251,7 +252,43 @@
"path": "express"
}
]
}
},
{
"root": "pages/microShop",
"pages": [{
"path": "index/index",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "myClients/myClients"
},
{
"path":"wdWithdrawal"
},
{
"path":"wdOrder"
},
{
"path":"wdCase"
},
{
"path":"shopSettings"
},
{
"path":"storeManagement/storeManagement"
},
{
"path":"storeManagement/goodsEdit"
},
{
"path":"storeManagement/addGoods"
}
]
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
......
<template>
<scroll-view
:scroll-y="true"
@scroll="scrollHandler"
@scrolltoupper="scrollTopHandler"
style="min-height: 100vh;">
<view class="microshopStyle" v-if="loading==false">
<view class="headStatus" :style="[headStyle]" >
<view class="arrow" @click="redirectPrev">
<u-icon name="arrow-left" size="48" color="#000000"></u-icon>
</view>
<view class="title" style="color: #000000;">{{pageTitle}}</view>
<view class="arrow" ></view>
</view>
</view>
<view class="microshopStyle" v-if="loading">
<view
class="headStatus"
v-if="scrollTop > 50 "
:style="[
headStyle,
{
zIndex: scrollTop < 10 ? 'unset' : 2,
opacity: scrollTop < 10 ? '100' : scrollTop,
background:'#FFF'
},
]"
>
<view class="arrow" @click="redirectPrev">
<u-icon name="arrow-left" size="48" color="#000"></u-icon>
</view>
<view class="title" style="color: #000000;" v-if="scrollTop > 50">{{pageTitle}}</view>
<view class="arrow"></view>
</view>
<view class="microshopbox" v-if="applyState ==0 || AuditStatus!=2 " >
<view class="headStatus" :style="[headStyle]" >
<view class="arrow" @click="redirectPrev">
<u-icon name="arrow-left" size="48" color="#fff"></u-icon>
</view>
<view class="title">{{pageTitle}}</view>
<view class="arrow"></view>
</view>
<view class="applyCont">
<view class="applybox">
<view class="applyitem">
<image src="../../../static/images/name.png" style="width: 17px;height: 18px;" mode="widthFix"></image>
<input class="uni-input" style="margin-left: 15px;" v-model="msg.Name" placeholder="请输入店名" />
</view>
<view class='applyitem'>
<u-checkbox-group>
<u-checkbox v-model="checked" shape="circle" :active-color="mainColor" label-size='28'
>我已阅读并同意</u-checkbox
>
</u-checkbox-group>
<Text style='font-size: 14px;color: #FF4048;' @click='showagreement'>《赞羊协议》</Text>
</view>
<view @click="apply" class="apply" v-if="AuditStatus !=1">
<Text >申请开店</Text>
</view>
<view class="apply" style="background:#ababab ;" v-if="AuditStatus ==1">
<Text >申请开店</Text>
</view>
</view>
</view>
</view>
<view style="width: 100%;height: 100%;" v-if="AuditStatus==2">
<view class="sharebox_top" :style="{ 'background-image': 'url(' + (SmallShops.CustomModel.HeadBackImage ? SmallShops.CustomModel.HeadBackImage : '') + ')', }">
<view class="headStatus2" :style="[headStyle]" >
<view class="arrow" @click="redirectPrev">
<u-icon name="arrow-left" size="48" color="#fff"></u-icon>
</view>
<view class="title">{{pageTitle}}</view>
<view class="arrow"></view>
</view>
<view class="sharebox_top_t">
<view class="top_t_l">
<u-avatar :src="SmallShops.UserInfo.Logo" size="130"></u-avatar>
<view style="display: flex;flex-direction: column;color: #fff;margin-left: 16px;">
<view style="display: flex;flex-direction: row;align-items: center">
<Text style='font-size: 18px;max-width: 150px;overflow: hidden;display: inline-block;white-space: nowrap; text-overflow:ellipsis;'>
{{SmallShops.UserInfo.UserName}}
</Text>
<view class="sj_style" style="" @click="goEdit('/pages/microShop/shopSettings')">
<image src="../../../static/images/jinbo.png" style="width: 13px;height: 13px;"></image>
</view>
</view>
<Text style='max-width:250px;font-size: 12px;margin-top: 5px;overflow: hidden;display: inline-block;white-space: nowrap; text-overflow:ellipsis;'>
{{SmallShops.UserInfo.Notice}}
</Text>
</view>
</view>
</view>
<view class="sharebox_topc">
<view class="center_item" style="font-size: 12px;color: #FFFFFF;justify-content: space-between;">
<Text>{{SmallShops.CustomModel.CommissionWithdrawnName}}</Text>
<Text>{{SmallShops.UserInfo.TXCommission!=null ?SmallShops.UserInfo.TXCommission:0}}</Text>
</view>
<view style="width: 2px;height: 25px;background: #FFFFFF;justify-content: space-between;"></view>
<view class="center_item" style="font-size: 12px;color: #FFFFFF;">
<Text >{{SmallShops.CustomModel.OutstandingCommissionName}}</Text>
<Text>{{SmallShops.UserInfo.WJSCommission!=null ?SmallShops.UserInfo.WJSCommission:0}}</Text>
</view>
</view>
</view>
<view class="sharebox_c">
<view style="display: flex;flex-direction: row;align-items: center;height: 55px;margin-left: -30px;">
<image src="../../../static/images/yue.png" style="width: 25px;height: auto;" mode ='widthFix'></image>
<view style="display: flex;flex-direction: column;margin-left: 17px;height: 100%;justify-content: space-between;">
<Text style='font-size: 22px;'>{{SmallShops.UserInfo.CommissionWithdrawal!=null ?SmallShops.UserInfo.CommissionWithdrawal:0}} <Text style='font-size: 14px;'></Text> </Text>
<text>{{SmallShops.CustomModel.WithdrawableName}}</text>
</view>
</view>
<view style="width: 60px;height: 30px;border-radius: 15px;color: #fff; margin-right: -30px;background-image: linear-gradient( to right,#FF8585,#ED4353);text-align: center;line-height: 30px;"
@click="goUrl('/pages/microShop/wdCase')"
>
<Text>{{SmallShops.CustomModel.WithdrawalText}}</Text>
</view>
</view>
<view class="sharebox_menus" >
<!-- 店铺订单 -->
<view class="menus_item" @click="goUrl('/pages/microShop/wdOrder')">
<view style="display: flex;flex-direction: row;align-items: center;">
<image :src="SmallShops.CustomModel.SmallShopOrderImage" style="width: 14px;height: auto;" mode='widthFix'></image>
<text style="font-size: 13px;color:#07090D;margin-left: 15px;">{{SmallShops.CustomModel.SmallShopOrderName}}</text>
</view>
<view style="display: flex;flex-direction: row;align-items: center;">
<text :style="{color:mainColor}">{{SmallShops.UserInfo.OrderCommission!=null ?SmallShops.UserInfo.OrderCommission:0}}</text>
<text style="color: #A5A3AB;margin-right: 5px;"></text>
<u-icon name="arrow" size="24" color="#A5A3AB"></u-icon>
</view>
</view>
<!-- 提现明细 -->
<view class="menus_item" @click="goUrl('/pages/microShop/wdWithdrawal')">
<view style="display: flex;flex-direction: row;align-items: center;">
<image :src="SmallShops.CustomModel.WithdrawalDetailImage" style="width: 14px;height: auto;" mode='widthFix'></image>
<text style="font-size: 13px;color:#07090D;margin-left: 15px;">{{SmallShops.CustomModel.WithdrawalDetailName}}</text>
</view>
<view style="display: flex;flex-direction: row;align-items: center;">
<text :style="{color:mainColor}">{{SmallShops.UserInfo.RemitMoney!=null ?SmallShops.UserInfo.RemitMoney:0}}</text>
<text style="color: #A5A3AB;margin-right: 5px;"></text>
<u-icon name="arrow" size="24" color="#A5A3AB"></u-icon>
</view>
</view>
<!-- 我的客户 -->
<view class="menus_item" @click="goUrl('/pages/microShop/myClients/myClients')">
<view style="display: flex;flex-direction: row;align-items: center;">
<image :src="SmallShops.CustomModel.MyCustomerImage" style="width: 14px;height: auto;" mode='widthFix'></image>
<text style="font-size: 13px;color:#07090D;margin-left: 15px;">{{SmallShops.CustomModel.MyCustomerName}}</text>
</view>
<view style="display: flex;flex-direction: row;align-items: center;">
<text :style="{color:mainColor}">{{SmallShops.UserInfo.ReferralsNum!=null ?SmallShops.UserInfo.ReferralsNum:0}}</text>
<text style="color: #A5A3AB;margin-right: 5px;"></text>
<u-icon name="arrow" size="24" color="#A5A3AB"></u-icon>
</view>
</view>
<!-- 店铺二维码 -->
<view class="menus_item" @click="goUrl()">
<view style="display: flex;flex-direction: row;align-items: center;">
<image :src="SmallShops.CustomModel.SmallShopQRCodeImage" style="width: 14px;height: auto;" mode='widthFix'></image>
<text style="font-size: 13px;color:#07090D;margin-left: 15px;">{{SmallShops.CustomModel.SmallShopQRCodeName}}</text>
</view>
<view style="display: flex;flex-direction: row;align-items: center;">
<u-icon name="arrow" size="24" color="#A5A3AB"></u-icon>
</view>
</view>
</view>
<!-- 店铺设置 -->
<view class="sharebox_menus">
<view class="menus_item" @click="goUrl('/pages/microShop/storeManagement/storeManagement')">
<view style="display: flex;flex-direction: row;align-items: center;">
<image :src="SmallShops.CustomModel.SmallShopSetUpImage" style="width: 14px;height: auto;" mode='widthFix'></image>
<text style="font-size: 13px;color:#07090D;margin-left: 15px;">{{SmallShops.CustomModel.SmallShopSetUpName}}</text>
</view>
<view style="display: flex;flex-direction: row;align-items: center;">
<u-icon name="arrow" size="24" color="#A5A3AB"></u-icon>
</view>
</view>
</view>
<!-- 直播设置 -->
<view class="sharebox_menus">
<view class="menus_item" @click="goUrl()">
<view style="display: flex;flex-direction: row;align-items: center;">
<image :src="SmallShops.CustomModel.LiveImage" style="width: 14px;height: auto;" mode='widthFix'></image>
<text style="font-size: 13px;color:#07090D;margin-left: 15px;">{{SmallShops.CustomModel.LiveName}}</text>
</view>
<view style="display: flex;flex-direction: row;align-items: center;">
<u-icon name="arrow" size="24" color="#A5A3AB"></u-icon>
</view>
</view>
</view>
<!-- 底部预留空间 -->
<view style="width: 100%;height: 30px;background: #f3f4f6;"></view>
</view>
<view class="agreementbox" v-if='isshowagreement==true || isshowagreement_t == true'></view>
<view class="agreementbox_t" v-if='isshowagreement==true'>
<view class="agreement_b">
<Text style='height: 40px;line-height: 40px;'>分销申请协议</Text>
<!-- <view>TODO内容</view> -->
<view style="width: 100%;height: 760rpx;padding: 20rpx;">
<Text>{{shopBasics.model.ApplyAgreement}}</Text>
</view>
<view class="agreement_bottom" :style="{background:mainColor}" @click="read">
<Text style='color: #fff;'>我已阅读</Text>
</view>
</view>
</view>
<view class="agreementbox_t" v-if='isshowagreement_t==true'>
<view class="tips_state">
<view style="color: #111111;font-size: 13px;margin-top: 306rpx;">{{AuditStatus ==1?'已提交,审核中':'已拒绝,重新申请'}} </view>
<view @click="isshowagreement_t = false" class="apply" style="width: 80%;margin-top: 30px;">
<Text >知道了</Text>
</view>
</view>
</view>
</view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'goback'></auth>
</scroll-view>
</template>
<script>
import auth from "../../../components/auth/index.vue";
export default {
components:{
auth,
},
data() {
return {
loading:false,
pageTitle:'开店申请',
showAuth:false,
nav:0,
headStyle:{},
msg:{
Name:'',
},
checked:false,
isshowagreement:false,
isshowagreement_t:false,
mainColor:'',
showAuth:false,
u:{},
applyState:0,//id==0 ,
AuditStatus:0,//审核状态 1审核中 2通过 3拒绝
ApplyInfo:{},
shopBasics:{},
SmallShops:{},
scrollTop:0,
}
},
created() {
this.nav = uni.getMenuButtonBoundingClientRect().top;
this.mainColor = this.$uiConfig.mainColor;
this.headStyle.paddingTop = this.nav +'px';
},
onLoad(){
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
}else{
this.init()
}
},
methods: {
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
// this.showAuth=false;
this.init()
},
goback(){
uni.navigateBack()
},
scrollHandler(e) {
this.scrollTop = e.detail.scrollTop;
//this.$forceUpdate();
},
scrollTopHandler() {
this.scrollTop = 0;
},
showagreement(){
this.isshowagreement = true
},
read(){
this.checked = true;
this.isshowagreement = false
},
init(){
uni.showLoading({
title: '加载中...'
});
uni.showNavigationBarLoading();
this.request2(
{
url: '/api/AppletUser/GetSmallShopsApplyInfo',
data: {}
},
(res) => {
this.getMicroShopBasics()
this.applyState = res.data.Id;
this.AuditStatus = res.data.AuditStatus;
this.ApplyInfo = res.data;
if(this.AuditStatus ==1 || this.AuditStatus ==3){
this.isshowagreement_t = true
}
}
);
},
getMicroShopBasics(){ //获取基础设置数据
this.request2(
{
url: '/api/AppletUser/GetMicroShopBasics',
data: {}
},
(res) => {
uni.hideNavigationBarLoading()
uni.hideLoading();
this.loading = true,//接口掉用完之后才显示页面
this.shopBasics = res.data;
if(this.AuditStatus ==2){
this.getSmallShopsCenter()//获取微店信息
this.pageTitle = '商店中心'
}
}
);
},
getSmallShopsCenter(){
this.request2(
{
url: '/api/AppletUser/GetSmallShopsCenter',
data: {}
},
(res) => {
this.SmallShops = res.data
}
);
},
apply(){
let that = this
uni.requestSubscribeMessage({
tmplIds: that.shopBasics.template_message_list,
complete (res) {
if(that.checked==false){
uni.showToast({
title: "请先查看协议并同意",
icon: "none"
});
return false
}
if(that.msg.Name==''){
uni.showToast({
title: "请输入店名",
icon: "none"
});
return false
}
uni.showLoading({
title: '申请中...'
});
that.request2(
{
url: '/api/AppletUser/ApplySmallShopsInfo',
data: that.msg
},
(res) => {
uni.hideLoading();
this.init()
}
);
}
})
},
goUrl(url){
console.log(url)
uni.navigateTo({
url: url
});
},
goEdit(url){
let data = encodeURIComponent(JSON.stringify(this.SmallShops.UserInfo))
uni.navigateTo({
url: url+'?data='+data
});
},
redirectPrev() {
if (this.prevPage != "") {
uni.navigateBack({
delta: 1,
});
}
},
}
}
</script>
<style>
.microshopStyle{
width: 100%;
height: 100vh;
background: #f3f4f6;
}
.microshopStyle .microshopbox{
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
background-image: url(https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/1597233144000_702.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.microshopStyle .headStatus {
overflow: hidden;
position: relative;
width: 140vw;
padding-right: 40vw;
padding-bottom: 10px;
position: fixed;
left: 0;
right: 0;
top: 0;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.microshopStyle .headStatus2{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
color: #FFFFFF;
}
.microshopStyle .arrow {
height: 24px;
margin: 5px 10px;
width: 24px;
}
.microshopStyle .headStatus .title {
font-size: 16px;
color: #FFF;
line-height: 34px;
}
.microshopStyle .applyCont{
width: 100%;
margin-top: 60%;
display: flex;
flex-direction: column;
align-items: center;
}
.microshopStyle .applybox{
width: 74%;
display: flex;
flex-direction: column;
align-items: center;
}
.microshopStyle .applyitem{
width: 100%;
height: 40px;
display: flex;
flex-direction: row;
align-items: center;
border-bottom: 1px solid #E2E2E2;
margin-top: 30px;
}
.microshopStyle .apply{
width: 100%;
height: 45px;
border-radius: 22.5px;
background: #FF4048;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
color: #FFFFFF;
margin-top: 60px;
}
.microshopStyle .agreementbox{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: #333333;
opacity: 0.3;
z-index: 888;
}
.microshopStyle .agreementbox_t{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 999;
display: flex;
align-items: center;
justify-content: center;
}
.microshopStyle .agreementbox_t .agreement_b{
width:80% ;
border-radius: 10px;
background: #fff;
display: flex;
flex-direction: column;
align-items: center;
overflow: hidden;
}
.microshopStyle .agreementbox_t .agreement_bottom{
width: 100%;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
}
.microshopStyle .tips_state{
width: 509rpx;
height: 554rpx;
display: flex;
flex-direction: column;
align-items: center;
background-image: url(../../../static/images/wdtzbg.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.microshopStyle .sharebox_top{
width: 100%;
/* padding: 10px; */
height: 242px;
display: flex;
flex-direction: column;
align-items: center;
background-repeat: no-repeat;
background-size: 100% 100%;
}
.microshopStyle .sharebox_top .sharebox_top_nav{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
height: 44px;
padding: 0 10px;
}
.microshopStyle .sharebox_top .sharebox_top_t{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
/* padding: 5px 0; */
margin-top: 20px;
}
.microshopStyle .sharebox_top .sharebox_top_t .top_t_l{
margin-left: 30px;
display: flex;
flex-direction: row;
align-items: flex-start;
}
.microshopStyle .sharebox_topc{
width: 94%;
height: 40px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
padding: 0 20px;
margin-top: 18px;
}
.microshopStyle .center_item{
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
}
.microshopStyle .sharebox_c{
width: 94%;
margin-left: 3%;
height: 99px;
border-radius: 10rpx;
background: #fff;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
margin-top: -15px;
}
.microshopStyle .sharebox_menus{
width: 94%;
margin-left: 3%;
border-radius: 10rpx;
background: #fff;
display: flex;
flex-direction: column;
align-items: center;
/* padding: 10px 0; */
margin-top: 10px;
}
.microshopStyle .sharebox_menus .menus_item{
width: 100%;
height: 45px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 0 15px;
}
.microshopStyle .sharebox_menus .menus_item .item_text{
font-size: 13px;
margin: 5px 0;
}
.microshopStyle .sj_style{
margin-left: 20px;
}
</style>
<template>
<view class="myClientsStyle" :style="{'height':contentHeight}">
<view style="width: 100%;height: 100%;">
<u-tabs :list="list" name="GradeName" :is-scroll="false" :current="current" @change="change" :active-color='mainColor' ></u-tabs>
<u-empty v-if="g.length==0" text="暂无数据" mode="data"></u-empty>
<template v-if="g.length > 0">
<view
style="
height: calc(100vh - 50px);
width: calc(100vw);
overflow: hidden;
">
<scroll-view
:scroll-y="true"
:enable-back-to-top="true"
:enable-flex="true"
@scrolltolower="lower"
:style="{ height: '100%' }">
<view style="display: flex;flex-direction: column;align-items: center;">
<view v-for="(item, index) in g" :key="index" class="listbox">
<view class="box_top">
<u-avatar :src="item.Photo" size="64"></u-avatar>
<view class="box_r">
<view style="width: 100%;display: flex;flex-direction: row;align-items: center;justify-content: space-between;">
<view style="width: 190px;">
<Text class='l_name'>{{item.UserName}}</Text>
</view>
<Text style='font-size: 12px;'>推广{{item.GeneralizeNum}}</Text>
</view>
<Text style='font-size: 10px;color: #999999;'>{{item.CreateDate}}</Text>
</view>
</view>
<view class="box_b">
<Text style='color: #878787;font-size: 13px;'> <text style='color: #FF3F47;'> {{item.Income}}</text></Text>
<Text style='color: #878787;font-size: 13px;'>{{item.OrderNum}}个订单</Text>
</view>
</view>
</view>
<u-loadmore
:status="status"
:load-text="loadText"
:font-size="24"
:margin-top="20"
:margin-bottom="20"
bg-color="#f3f4f6"
/>
</scroll-view>
</view>
</template>
</view>
</view>
</template>
<script>
export default {
data() {
return {
pageTitle: "我的团队",
contentHeight:0,
mainColor:'',
secondary:'',
current:0,
g:[],
list:[
],
msg2:{
pageIndex: 1,
pageSize:10,
FXGradeId:0,
},
page_count:1,
status: "loadmore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
IsEnableFXGrade:0,
}
},
created(){
this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
this.mainColor = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
},
onLoad(option){
this.list=[{GradeName: '普通会员'},]//设置默认值
this.getUserMyTeamTitelListForFX()
},
mounted() {
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
methods: {
getUserMyTeamTitelListForFX(){
uni.showLoading({
title: '加载中'
});
this.request2(
{
url: '/api/AppletUser/GerSmallShopsMyTeamTitelListForFX',
data: {}
},
(res) => {
uni.hideLoading();
this.list=res.data;
this.msg2.FXGradeId = this.list[0].Id;
this.init2()
}
);
},
init2(){
uni.showLoading({
title: '加载中'
});
this.request2(
{
url: '/api/AppletUser/GetUserMyTeamPageListForFX',
data: this.msg2
},
(res) => {
uni.hideLoading();
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
}
}
);
},
change(index){
this.current = index
this.msg2.FXGradeId = this.list[index].Id;
this.msg2.pageIndex=1;
this.g=[]
this.init2()
},
lower(e) {
if (this.msg2.pageIndex < this.page_count) {
this.msg2.pageIndex++;
this.status = "loading";
this.init2();
} else {
this.status = "nomore";
}
},
}
}
</script>
<style>
.myClientsStyle{
background: #f3f4f6;
}
.myClientsStyle .loading{
width: 200rpx;
height: 200rpx;
background: #000000;
opacity: 0.7;
border-radius: 10rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: fixed;
left: 50%;
top:30%;
margin-left: -100rpx;
z-index: 999;
}
.myClientsStyle .listbox{
width: 100%;
background: #fff;
padding: 0 15px;
margin-top: 15px;
display: flex;
flex-direction: column;
align-items: center;
}
.myClientsStyle .box_top{
width:100% ;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 10px 0 ;
/* border-bottom: 1px solid #f5f5f5; */
}
.myClientsStyle .box_r{
width: calc(100vw - 30px - 32px - 20px);
height: 32px;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.box_r .l_name{
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.myClientsStyle .box_b{
width: 100%;
height: 40px;
padding: 0 10px;
background: #F7F5F5;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border-radius: 4px;
margin: 10px 0;
}
</style>
<template>
<view class="shopSettingsStyle" :style="{'height':contentHeight}">
<view class="shopsetBox">
<view class="box_item">
<span style="font-weight: bold;">店铺logo</span>
<view style="width: 50px;height: 50px;border-radius: 25px;" @click="chooseTheImg">
<image :src="msg.Logo" style="width: 50px;height: 50px;border-radius: 25px;" mode="aspectFit"></image>
</view>
</view>
<view style="width: 94%;height: 1px;background: #E8E8E8;margin: 5px 0;"></view>
<view class="box_item">
<span style="font-weight: bold;">店铺名称</span>
<input type="text" v-model="msg.Name" style="width: 200px;text-align: right;">
</view>
</view>
<view class="shopsetBox">
<view class="box_item">
<span style="font-weight: bold;">店铺公告</span>
</view>
<textarea
placeholder="请输入店铺公告.."
style="font-size:14px;color:#111111;width: 94%;margin: 15px 0;"
:value="msg.Notice"
@input='identifybtn'
/>
</view>
<view class="btn" @click="save">
修改
</view>
</view>
</template>
<script>
export default {
data() {
return {
pageTitle: "店铺信息设置",
contentHeight:0,
mainColor:'',
secondary:'',
msg:{
Name:'',
Logo:'',
Notice:'',
}
}
},
onLoad(options){
if(options){
let data = JSON.parse(decodeURIComponent(options.data))
this.msg.Name = data.UserName;
this.msg.Logo = data.Logo;
this.msg.Notice = data.Notice;
}
},
created(){
this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
this.mainColor = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
// this.init()
},
mounted() {
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length-1].route;
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
methods: {
save(){
let pages = getCurrentPages(); // 当前页面
let beforePage = pages[pages.length - 2]; // 前一个页面
uni.showLoading({
title: '加载中'
});
this.request2(
{
url: '/api/AppletUser/UpdateShopsInfo',
data: this.msg
},
(res) => {
uni.hideLoading();
uni.showToast({
title: res.data,
icon: "none",
});
setTimeout(()=>{
uni.navigateBack({
success: function() {
beforePage.$vm.getSmallShopsCenter(); // 执行前一个页面的方法
}
});
},1000)
}
);
},
identifybtn(val){
this.msg.Notice = val.detail.value
},
chooseTheImg(){
let that = this
uni.chooseImage({
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album'], //从相册选择
success: function (res) {
let imgUrl = res.tempFilePaths[0]
console.log(imgUrl)
that.msg.Logo = imgUrl
}
});
}
}
}
</script>
<style>
.shopSettingsStyle{
background: #f3f4f6;
}
.shopSettingsStyle .shopsetBox{
width: 100%;
background: #FFFFFF;
display: flex;
flex-direction: column;
align-items: center;
margin-top: 20px;
}
.shopSettingsStyle .box_item{
width: 94%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
font-size: 14px;
color: #000000;
padding: 15px 0;
}
.shopSettingsStyle .btn{
width: 94%;
height: 45px;
border-radius: 22.5px;
margin-left: 3%;
background: #FF4048;
font-size: 16px;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
margin-top: 70px;
}
</style>
<template>
<view class="addGoodsStyle" :style="{'height':contentHeight}">
<view style="width: 100%;height: 100%;">
<view style="padding: 5px 10px;background: #FFFFFF;">
<u-search
action-text="搜索"
:focus="true"
:clearabled="true"
:show-action="true"
radius="40"
v-model="searchKey"
@search="searchHandler"
@custom="searchHandler"
></u-search>
</view>
<u-empty v-if="g.length==0" text="暂无数据" mode="data"></u-empty>
<template v-if="g.length > 0">
<view
style="
height: calc(100vh - 50px);
width: calc(100vw);
overflow: hidden;
padding: 10px 0;
">
<scroll-view
:scroll-y="true"
:enable-back-to-top="true"
:enable-flex="true"
@scrolltolower="lower"
:style="{ height: '100%' }">
<view style="display: flex;flex-direction: column;align-items: center;">
<view v-for="(item, index) in g" :key="index" class="listbox">
<view class="box_c" >
<image :src="item.CoverImage" style="width: 65px;height: 65px;border-radius: 6px;"></image>
<view style="width: calc(100vw - 30px - 65px - 15px);display: flex;flex-direction: column;margin-left: 15px;">
<view class="box_c_name">{{item.Name}}</view>
<view style="width:100%;height: 20px;display: flex;align-items: center;justify-content: flex-end;margin-top: 10px;">
<view class="allEdit" @click="addGoods(item)">
添加
</view>
</view>
</view>
</view>
<view class="SupplierListstyle">
<view class="Sitem" v-for="(x, index2) in item.SpecificationList" :key="index2" v-if='item.showdetail == true || index2==0' @click=" isdetail(index,index2) ">
<view class="Sitem_gg" >
<text v-for="(j, index3) in x.AttrList" :key="index3">{{j.attr_group_name}}:{{j.attr_name}}{{x.attr_list.length==index3+1?'':','}}</text>
</view>
<u-icon name="arrow" v-if='item.showdetail==false && index2==0 && item.SpecificationList.length>1' ></u-icon>
<u-icon name="arrow-down" v-if='item.showdetail==true && index2==0&& item.SpecificationList.length>1'></u-icon>
</view>
</view>
</view>
</view>
<u-loadmore
:status="status"
:load-text="loadText"
:font-size="24"
:margin-top="20"
:margin-bottom="20"
bg-color="#f3f4f6"
/>
</scroll-view>
</view>
</template>
</view>
</view>
</template>
<script>
export default {
data() {
return {
pageTitle: "添加商品",
contentHeight:0,
mainColor:'',
secondary:'',
g:[],
msg:{
pageIndex: 1,
pageSize:10,
Id:0,
GoodsName:'',
},
page_count:1,
status: "loadmore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
}
},
created(){
this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
this.mainColor = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
this.init()
},
mounted() {
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length-1].route;
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
methods: {
init(){
uni.showLoading({
title: '加载中'
});
this.request2(
{
url: '/api/AppletSmallShops/GetSmallShopsChooseGoodsPageList',
data: this.msg
},
(res) => {
uni.hideLoading();
let list = res.data.pageData;
list.forEach((x)=>{
x.showdetail = false
})
this.g = this.g.concat(list);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
}
}
);
},
isdetail(index){
this.g[index].showdetail = !this.g[index].showdetail
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
},
searchHandler(val){
this.msg.GoodsName = val;
this.g= [];
this.msg.pageIndex = 1;
this.init()
},
addGoods(data){
data.SpecificationList.forEach(x=>{
x.UpPrice = 0;
x.PriceType = 0;
})
let obj = encodeURIComponent(JSON.stringify(data))
uni.navigateTo({
url:'/pages/microShop/storeManagement/goodsEdit?data='+obj+'&type=2'
});
}
}
}
</script>
<style>
.addGoodsStyle{
background: #f3f4f6;
}
.addGoodsStyle .listbox{
width: 100%;
background: #fff;
padding: 0 15px;
margin-bottom: 15px;
display: flex;
flex-direction: column;
align-items: center;
}
.addGoodsStyle .listbox .box_top{
width: 100%;
height: 45px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #f5f5f5;
}
.addGoodsStyle .listbox .box_center{
width: 100%;
height: 45px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
font-size: 13px;
}
.addGoodsStyle .center_l{
display: flex;flex-direction: row;align-items: center;
}
.addGoodsStyle .listbox .box_ltext{
width: 90px;
margin-left: 5px;
}
.addGoodsStyle .listbox .l_name{
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.addGoodsStyle .listbox .box_bottom{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 15px 0 0;
border-top: 1px solid #f5f5f5;
font-size: 13px;
}
.box_bottom .b_r{
width: calc(100vw - 30px - 50px - 20px);
display: flex;
flex-direction: column;
justify-content: space-between;
}
.addGoodsStyle .search{
width: 100%;
height: 50px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 0 15px;
background: #FFFFFF;
}
.addGoodsStyle .listbox{
width: 100%;
margin-bottom: 10px;
padding: 15px;
background: #fff;
display: flex;
flex-direction: column;
align-items: center
}
.addGoodsStyle .box_c{
display: flex;
flex-direction: row;
width: 100%;
overflow: hidden;
margin-top: 15px;
}
.addGoodsStyle .box_c_name{
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
font-size: 13px;
color: #111111;
}
.addGoodsStyle .SupplierListstyle{
width: 100%;
background: #F8F6F5;
display: flex;
flex-direction: column;
align-items: center;
margin-top: 10px;
}
.addGoodsStyle .Sitem{
width: 96%;
display: flex;
flex-direction: row;
align-items: center;
font-size: 11px;
color: #888888;
height: 35px;
margin-left: 2%;
}
.addGoodsStyle .Sitem_gg{
width: 90%;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
line-clamp: 1;
-webkit-box-orient: vertical;
}
.addGoodsStyle .allEdit{
width: 60px;
height: 24px;
border-radius: 12px;
background: #FF4048;
display: flex;
align-items: center;
justify-content: center;
color: #FFFFFF
}
</style>
<template>
<view class="goodsEditStyle" :style="{'height':contentHeight}">
<view class="listbox">
<view class="box_c" >
<image :src="g.CoverImage" style="width: 65px;height: 65px;border-radius: 6px;"></image>
<view style="width: calc(100vw - 30px - 65px - 15px);display: flex;flex-direction: column;margin-left: 15px;">
<view class="box_c_name">{{g.Name}}</view>
</view>
</view>
<view style="width: 100%;padding: 0 15px;font-size: 10px;color: #8E8E8E;">
注:1,百分比范围:{{editMsg.CustomMinPriceRate}}% ~ {{editMsg.CustomMaxPriceRate}}%
</view>
<view style="width: 100%;padding: 0 15px;font-size: 10px;color: #8E8E8E" >
2,固定金额范围:{{editMsg.CustomMinFixedPrice}}元 ~ {{editMsg.CustomMaxFixedPrice}}
</view>
<view class="SupplierListstyle">
<view style="width: 96%;height: 40px;display: flex;flex-direction: row;align-items: center;justify-content: space-between;border-bottom: 1px solid #E2E2E2;">
<u-checkbox-group @change="SelectAll" size='30'>
<u-checkbox v-model="allchecked" shape="circle" :active-color="mainColor">全选</u-checkbox>
</u-checkbox-group>
<view class="allEdit" @click="batchset" >
批量设置
</view>
</view>
<view class="Sitem" v-for="(x, index2) in g.SpecificationList" :key="index2" >
<u-checkbox-group @change="clickcheckbox(x)" size='30' style='margin-right: 5px;width: 50%; ' >
<u-checkbox v-model="x.checked" shape="circle" :active-color="mainColor" label-size='22'>
<view class="Sitem_gg" >
<text v-for="(j, index3) in x.AttrList" :key="index3">{{j.attr_group_name}}:{{j.attr_name}}{{x.attr_list.length==index3+1?'':','}}</text>
</view>
</u-checkbox>
</u-checkbox-group>
<view class="Sitem_k" style="width: 20%;display: flex;flex-direction: row;align-items: center;" @click="selectType(x,index2,1)">
<view v-if="x.PriceType ==1 ">百分比</view>
<view v-if="x.PriceType ==2 ">固定金额</view>
<view v-if="x.PriceType !=1 && x.PriceType !=2 " >请选择</view>
<u-icon name="arrow-down" style='margin-left: 3px;'></u-icon>
</view>
<view class="Sitem_k" v-if="x.PriceType ==1 " style="display: flex;flex-direction: row;align-items: center">
<view style="width: 44px;">百分比:</view>
<input class="uni-input inputM Sitem_k" v-model="x.UpPrice" @blur='verification(x,index2)' />
%
</view>
<view class="Sitem_k" v-if="x.PriceType ==2 " style="display: flex;flex-direction: row;align-items: center;">
<view style="width: 44px;">国定金额:</view>
<input class="uni-input inputM Sitem_k" v-model="x.UpPrice" @blur='verification(x,index2)'/>
</view>
<view class="Sitem_k" v-if="x.PriceType !=2&& x.PriceType !=1 " style="color: #FF4048;">0</view>
</view>
</view>
</view>
<!-- 修改按钮 -->
<view class="popup_b" :style="{height:cHeight+'px'}">
<view class="popup_b_item" :style="{background:mainColor }" @click="determine()">
<text>保存</text>
</view>
</view>
<u-popup v-model="ISpopup"
mode="center"
length="90%"
>
<view class="popupbox_t">
<view style="padding: 10px 0;">
全局设置
</view>
<view style="width: 90%;height: 45px;border: 1px solid #DCDCDC;display: flex;flex-direction: row;align-items: center;justify-content: space-around;border-radius: 22.5px;margin:15px 0;" @click="showmodel=true">
<view></view>
<span v-if="editMsg.PriceType==1" style='font-size: 14px;color: #08090E;'>百分比</span>
<span v-if="editMsg.PriceType==2" style='font-size: 14px;color: #08090E;'>固定金额</span>
<span v-if="editMsg.PriceType==null" style='font-size: 14px;color: #08090E;'>请选择</span>
<u-icon name="arrow-down" size="20" color="#000"></u-icon>
</view>
<span v-if="editMsg.PriceType==1" style='font-size: 11px;'>百分比范围:{{editMsg.CustomMinPriceRate}}% ~ {{editMsg.CustomMaxPriceRate}}%</span>
<span v-if="editMsg.PriceType==2" style='font-size: 11px;'>固定金额范围:{{editMsg.CustomMinFixedPrice}}元 ~ {{editMsg.CustomMaxFixedPrice}}</span>
<view style="width: 90%;display: flex;flex-direction: row;border-bottom: 1px solid #ABABAB;align-items: center;justify-content: center;">
<input type="text" style="width: 100px;text-align: center;padding: 10px 0;font-size: 35px;height: 50px;" v-model="editMsg.UpPrice">
<span v-if="editMsg.PriceType==1" style='font-size: 20px;margin-left: 15px;'>%</span>
<span v-if="editMsg.PriceType==2" style='font-size: 20px;margin-left: 15px;'></span>
</view>
<view style="width: 90%;height: 45px;border-radius: 22.5px;background: #FF4048;font-size: 16px;color: #FFFFFF;display: flex;align-items: center;justify-content: center;margin: 15px 0;" @click="define">
确认
</view>
<view style="position: absolute;right: 0;top: 0;width: 50px;height: 50px;display: flex;align-items: center;justify-content: center;" @click="ISpopup= false">
<u-icon name="cross" size="24" color="#000" ></u-icon>
</view>
</view>
</u-popup>
<u-popup v-model="showmodel"
mode="bottom"
border-radius="16"
>
<view class="popupBox_tr">
<view class="popup_top">
<view></view>
<Text>类型</Text>
<u-icon name="cross" color='#9F9F9F' @click='showmodel=false' size="40"></u-icon>
</view>
<view class="txtype">
<view class="typeitem" v-for="(item, index) in array" :key="index" >
<Text>{{item.Name}}</Text>
<u-radio-group v-model="value">
<u-radio
v-model = 'item.checked'
:active-color="mainColor"
shape="circle"
:name="item.Name"
@change="radioChange(item)"
>
</u-radio>
</u-radio-group>
</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
data() {
return {
pageTitle: "商品价格设置",
contentHeight:0,
mainColor:'',
secondary:'',
g:{},
cHeight:0,
showmodel:false,
array:[
{type:1,Name:'百分比'},{type:2,Name:'固定金额'}
],
Stype:1,//1为单个设置 2位批量
Sindex:0,
value:'',
allchecked:false,
ISpopup:false,
editMsg:{},
gotype:1
}
},
onLoad(options){
if(options){
let data = JSON.parse(decodeURIComponent(options.data))
this.g = data
this.g.SpecificationList.forEach(x=>{
x.checked = false
})
this.gotype = options.type
}
},
created(){
this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
this.cHeight = this.$uiConfig.is_bang ? 80 : 52;
this.mainColor = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
this.init()
},
mounted() {
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length-1].route;
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
methods: {
init(){
this.request2(
{
url: '/api/AppletSmallShops/GetSmallShopsGlobalPrice',
data: {}
},
(res) => {
this.editMsg = res.data;
}
);
},
selectType(item,index,type){
if(item.PriceType ==1){
this.value = '百分比'
}else if(item.PriceType ==2){
this.value = '固定金额'
}else{
this.value = ''
}
this.Sindex = index;
this.Stype = type;
this.showmodel = true
},
radioChange(item){
if(this.Stype ==1){
this.g.SpecificationList[this.Sindex].PriceType = item.type;
if(item.type ==1){//切换类型时 值为范围值的最小值
this.g.SpecificationList[this.Sindex].UpPrice = this.editMsg.CustomMinPriceRate;
}else if(item.type ==2){
this.g.SpecificationList[this.Sindex].UpPrice = this.editMsg.CustomMinFixedPrice;
}
this.value = item.Name;
this.showmodel =false
}else if(this.Stype ==2){
this.editMsg.PriceType = item.type;
this.value = item.Name;
this.showmodel =false
}
},
SelectAll(){
if(this.allchecked == true){
this.g.SpecificationList.forEach(x=>{
x.checked = true
})
}else{
this.g.SpecificationList.forEach(x=>{
x.checked = false
})
}
this.$forceUpdate()
},
clickcheckbox(x){
if(x.checked == true){
let show = true;
this.g.SpecificationList.forEach(x=>{
if(x.checked == false){
show = false
}
})
if(show==true){
this.allchecked = true
}
}else{
this.allchecked = false
}
this.$forceUpdate()
},
batchset(){
let show = true;
this.Stype = 2;
this.g.SpecificationList.forEach(x=>{
if(x.checked == true){
show = false
}
})
if(show==true){
uni.showToast({
title: '请至少选择一个规格',
icon: "none",
});
return
};
if(this.editMsg.PriceType ==1){
this.value = '百分比'
}else if(this.editMsg.PriceType ==2){
this.value = '固定金额'
}
this.ISpopup = true;
},
define(){
if(this.editMsg.PriceType==1 && (this.editMsg.UpPrice<this.editMsg.CustomMinPriceRate || this.editMsg.UpPrice>this.editMsg.CustomMaxPriceRate)){
uni.showToast({
title: '百分比不在范围内',
icon: "none",
});
this.editMsg.UpPrice = this.editMsg.CustomMinPriceRate
return
}
if(this.editMsg.PriceType==2 && (this.editMsg.UpPrice<this.editMsg.CustomMinFixedPrice || this.editMsg.UpPrice>this.editMsg.CustomMaxFixedPrice)){
uni.showToast({
title: '固定金额不在范围内',
icon: "none",
});
this.editMsg.UpPrice = this.editMsg.CustomMinFixedPrice
return
}
this.g.SpecificationList.forEach(x=>{
if(x.checked == true){
x.PriceType = this.editMsg.PriceType;
x.UpPrice = this.editMsg.UpPrice;
x.checked = false
}
})
this.allchecked = false
this.ISpopup = false;
},
verification(x,i){
if(x.PriceType==1 && (x.UpPrice<this.editMsg.CustomMinPriceRate || x.UpPrice>this.editMsg.CustomMaxPriceRate)){
uni.showToast({
title: '百分比不在范围内',
icon: "none",
});
this.g.SpecificationList[i].UpPrice = this.editMsg.CustomMinPriceRate
return
}
if(x.PriceType==2 && (x.UpPrice<this.editMsg.CustomMinFixedPrice || x.UpPrice>this.editMsg.CustomMaxFixedPrice)){
uni.showToast({
title: '固定金额不在范围内',
icon: "none",
});
this.g.SpecificationList[i].UpPrice = this.editMsg.CustomMinFixedPrice
return
}
},
determine(){
let msg = {
GoodsId:this.g.GoodsId,
PriceList:[]
}
this.g.SpecificationList.forEach(x=>{
let obj = {}
obj.GoodsId = x.GoodsId;
obj.SpecificationKey = x.SpecificationKey;
obj.UpPrice = x.UpPrice;
obj.PriceType = x.PriceType;
msg.PriceList.push(obj)
})
let pages = getCurrentPages(); // 当前页面
let beforePage
if(this.gotype == 1){
beforePage = pages[pages.length - 2]; // 前一个页面
}else if(this.gotype == 2){
beforePage = pages[pages.length - 3]; // 前一个页面
}
console.log(beforePage)
console.log(this.gotype)
uni.showLoading({
title: '加载中'
});
this.request2(
{
url: '/api/AppletSmallShops/SetSmallShopsGoodsPrice',
data: msg
},
(res) => {
uni.hideLoading();
uni.showToast({
title: res.message,
icon: "none",
});
if(this.gotyp == 1){
setTimeout(()=>{
uni.navigateBack({
delta:1,
success: function() {
beforePage.$vm.getSmallShopsGoodsPricePageList(2); // 执行前一个页面的方法
}
});
},1000)
}else if(this.gotyp == 2){
setTimeout(()=>{
uni.navigateBack({
delta:2,
success: function() {
beforePage.$vm.getSmallShopsGoodsPricePageList(2); // 执行前一个页面的方法
}
});
},1000)
}
}
);
},
}
}
</script>
<style>
.goodsEditStyle{
background: #f3f4f6;
}
.goodsEditStyle .listbox{
width: 100%;
margin-bottom: 100px;
/* padding: 15px; */
background: #fff;
display: flex;
flex-direction: column;
align-items: center;
}
.goodsEditStyle .box_c{
display: flex;
flex-direction: row;
width: 100%;
overflow: hidden;
margin-top: 15px;
padding: 15px;
}
.goodsEditStyle .box_c_name{
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
font-size: 13px;
color: #111111;
}
.goodsEditStyle .box_r_b{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-top: 3px;
}
.goodsEditStyle .SupplierListstyle{
width: 100%;
/* background: #F8F6F5; */
display: flex;
flex-direction: column;
align-items: center;
margin-top: 10px;
}
.goodsEditStyle .Sitem{
width: 96%;
display: flex;
flex-direction: row;
align-items: center;
font-size: 10px;
color: #888888;
height: 35px;
border-bottom: 1px solid #E2E2E2;
}
.goodsEditStyle .Sitem_gg{
width: 100%;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
line-clamp: 1;
-webkit-box-orient: vertical;
}
.Sitem_k{
width: 35%;
text-align: center;
/* line-height: 25px; */
}
.goodsEditStyle .inputM{
width: 45%;
border: 1px solid #E2E2E2;
margin: 0 3px;
}
.goodsEditStyle .popupBox_tr{
width: 100%;
padding-bottom: 15px;
}
.goodsEditStyle .popupBox_tr .popup_top{
width: 100%;
height: 45px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 0 15px;
}
.goodsEditStyle .typeitem{
padding: 15px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border-top:1px solid #f5f5f5
}
.goodsEditStyle .allEdit{
width: 80px;
height: 24px;
border-radius: 12px;
background: #FF4048;
display: flex;
align-items: center;
justify-content: center;
color: #FFFFFF
}
.goodsEditStyle .popupbox_t{
width: 100%;
border-radius: 10px;
background: #FFF;
display: flex;
flex-direction: column;
align-items: center;
padding: 10px;
position: relative;
}
.goodsEditStyle .popup_b{
width: 100%;
position: fixed;
left: 0;
bottom: 0;
display: flex;
flex-direction: row;
align-items: center;
color: #FFFFFF;
}
.goodsEditStyle .popup_b_item{
width: 100%;
height: 100%;
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: center;
font-size: 14px;
padding-top: 15px;
}
</style>
<template>
<view class="storeManagementStyle" :style="{'height':contentHeight}">
<!-- 全局设置 -->
<view style="width: 100%;height: 100%;">
<view class="overallSet">
<view class="overallSet_top" style="height: 54px;" >
<view class="topflex">
<view style="width: 3px ;height: 13px;background: #007FFF;"></view>
<span style='font-weight: bold;margin-left: 7px;'>全局设置</span>
</view>
<view class="allEdit" @click="popupAll">
修改
</view>
</view>
<view style="width: 94%;height: 1px;background: #E2E2E2;"></view>
<view class="overallSet_center" style="height: 72px;">
<view style="display: flex;flex-direction: column;">
<span v-if="getSmallGPrice.PriceType==1" style='font-size: 14px;color: #08090E;'>百分比</span>
<span v-if="getSmallGPrice.PriceType==2" style='font-size: 14px;color: #08090E;'>固定金额</span>
<span v-if="getSmallGPrice.PriceType==1" style='font-size: 11px;color: #8E8E8E;margin-top: 8px;'>(所有商品在原价基础上上涨的百分比)</span>
<span v-if="getSmallGPrice.PriceType==2" style='font-size: 11px;color: #8E8E8E;margin-top: 8px;'>(所有商品在原价基础上上涨的固定金额)</span>
<span v-if="getSmallGPrice.PriceType==null" style='font-size: 14px;color: #08090E;'>暂无设置</span>
</view>
<view style="display: flex;flex-direction: row;align-items: flex-end;">
<span style='font-size: 20px;color: #000000;'>{{getSmallGPrice.UpPrice?getSmallGPrice.UpPrice:0}}</span>
<span v-if="getSmallGPrice.PriceType==1" style='font-size: 13px;color: #08090E;margin-left: 3px;'>%</span>
<span v-if="getSmallGPrice.PriceType==2" style='font-size: 13px;color: #08090E;margin-left: 3px;'></span>
</view>
</view>
</view>
<!-- 商品设置 -->
<view class="overallSet" style="background: #f3f4f6;">
<view class="overallSet_top" style="height: 54px;background: #FFF;width: 100%;padding: 0 3%; ">
<view class="topflex" >
<view style="width: 3px ;height: 13px;background: #007FFF;"></view>
<span style='font-weight: bold;margin-left: 7px;'>单独设置</span>
</view>
<view style="display: flex;flex-direction: row;align-items: center">
<view style="width: 75px;height: 40px;display: flex;flex-direction: row;align-items: center;justify-content: center;background: #FFFFFF;" @click="show = true">
<text>筛选</text>
<image src="../../../static/images/shaix.png" style="width: 11px;height: 13px;"></image>
</view>
<view class="allEdit" @click="addShop" style="width: 80px;">
添加商品
</view>
</view>
</view>
<u-empty v-if="g.length==0" text="暂无数据" mode="data"></u-empty>
<template v-if="g.length > 0">
<view
style="
height: calc(100vh - 54px-54px - 72px - 20px);
width: calc(100vw);
padding: 10px 0;
">
<scroll-view
:scroll-y="true"
:enable-back-to-top="true"
:enable-flex="true"
@scrolltolower="lower"
:style="{ height: '100%' }">
<view style="display: flex;flex-direction: column;align-items: center;">
<view v-for="(item, index) in g" :key="index" class="listbox">
<view class="box_c" >
<image :src="item.CoverImage" style="width: 65px;height: 65px;border-radius: 6px;"></image>
<view style="width: calc(100vw - 30px - 65px - 15px);display: flex;flex-direction: column;margin-left: 15px;">
<view class="box_c_name">{{item.Name}}</view>
<view style="width:100%;height: 20px;display: flex;align-items: center;justify-content: flex-end;">
<view style="width: 20px;height: 20px;align-items: center;justify-content: center;display: flex;" @click="itemEdit(item)">
<image src="../../../static/images/edit.png" style="width: 15px;height: 15px;"></image>
</view>
</view>
</view>
</view>
<view class="SupplierListstyle">
<view class="Sitem" v-for="(x, index2) in item.SpecificationList" :key="index2" v-if='item.showdetail == true || index2==0' @click=" isdetail(index,index2) ">
<view class="Sitem_gg" >
<text v-for="(j, index3) in x.AttrList" :key="index3">{{j.attr_group_name}}:{{j.attr_name}}{{x.attr_list.length==index3+1?'':','}}</text>
</view>
<view class="Sitem_k" style="width: 20%;">原价:¥{{x.SellingPrice}}</view>
<view class="Sitem_k" v-if="x.PriceType ==1 " style="color: #007FFF;">百分比:{{x.UpPrice}} %</view>
<view class="Sitem_k" v-if="x.PriceType ==2 " style="color: #007FFF;">国定金额:{{x.UpPrice}}</view>
<view class="Sitem_k" v-if="x.PriceType !=2&& x.PriceType !=1 " style="color: #FF4048;">未设置</view>
<u-icon name="arrow" v-if='item.showdetail==false && index2==0&& item.SpecificationList.length>1' ></u-icon>
<u-icon name="arrow-down" v-if='item.showdetail==true && index2==0&& item.SpecificationList.length>1'></u-icon>
</view>
</view>
</view>
<!-- <view style="width: 100%;height: 900px;"></view> -->
</view>
<u-loadmore
:status="status"
:load-text="loadText"
:font-size="24"
:margin-top="20"
:margin-bottom="20"
bg-color="#f3f4f6"
/>
</scroll-view>
</view>
</template>
</view>
<u-popup v-model="ISpopup"
mode="center"
length="90%"
>
<view class="popupbox_t">
<view style="padding: 10px 0;">
全局设置
</view>
<view style="width: 90%;height: 45px;border: 1px solid #DCDCDC;display: flex;flex-direction: row;align-items: center;justify-content: space-around;border-radius: 22.5px;margin:15px 0;" @click="showmodel=true">
<view></view>
<span v-if="editMsg.PriceType==1" style='font-size: 14px;color: #08090E;'>百分比</span>
<span v-if="editMsg.PriceType==2" style='font-size: 14px;color: #08090E;'>固定金额</span>
<span v-if="editMsg.PriceType==null" style='font-size: 14px;color: #08090E;'>请选择</span>
<u-icon name="arrow-down" size="20" color="#000"></u-icon>
</view>
<span v-if="editMsg.PriceType==1" style='font-size: 11px;'>百分比范围:{{editMsg.CustomMinPriceRate}}% ~ {{editMsg.CustomMaxPriceRate}}%</span>
<span v-if="editMsg.PriceType==2" style='font-size: 11px;'>固定金额范围:{{editMsg.CustomMinFixedPrice}}元 ~ {{editMsg.CustomMaxFixedPrice}}元</span>
<view style="width: 90%;display: flex;flex-direction: row;border-bottom: 1px solid #ABABAB;align-items: center;justify-content: center;">
<input type="text" style="width: 100px;text-align: center;padding: 10px 0;font-size: 35px;height: 50px;" v-model="editMsg.UpPrice">
<span v-if="editMsg.PriceType==1" style='font-size: 20px;margin-left: 15px;'>%</span>
<span v-if="editMsg.PriceType==2" style='font-size: 20px;margin-left: 15px;'></span>
</view>
<view style="width: 90%;height: 45px;border-radius: 22.5px;background: #FF4048;font-size: 16px;color: #FFFFFF;display: flex;align-items: center;justify-content: center;margin: 15px 0;" @click="define">
确认
</view>
<view style="position: absolute;right: 0;top: 0;width: 50px;height: 50px;display: flex;align-items: center;justify-content: center;" @click="ISpopup= false">
<u-icon name="cross" size="24" color="#000" ></u-icon>
</view>
</view>
</u-popup>
<u-popup v-model="showmodel"
mode="bottom"
border-radius="16"
>
<view class="popupBox_tr">
<view class="popup_top">
<view></view>
<Text>类型</Text>
<u-icon name="cross" color='#9F9F9F' @click='showmodel=false' size="40"></u-icon>
</view>
<view class="txtype">
<view class="typeitem" v-for="(item, index) in array" :key="index" >
<Text>{{item.Name}}</Text>
<u-radio-group v-model="value">
<u-radio
v-model = 'item.checked'
:active-color="mainColor"
shape="circle"
:name="item.Name"
@change="radioChange(item)"
>
</u-radio>
</u-radio-group>
</view>
</view>
</view>
</u-popup>
<u-popup v-model="show"
mode="right"
length="70%"
height='100%'
>
<view class="popupbox">
<text class="popupbox_text" style="margin-top: 15px;">商品ID</text>
<view class="popup_item">
<input class="uni-input inputM" v-model="msg.GoodsId" />
</view>
<text class="popupbox_text" style="margin-top: 15px;">商品名称</text>
<view class="popup_item">
<input class="uni-input inputM" v-model="msg.GoodsName" />
</view>
<view class="popup_b" :style="{height:cHeight+'px'}">
<view class="popup_b_item" style="background: #FAF8F9;color: #000000;" @click="goreset()">
<text>重置</text>
</view>
<view class="popup_b_item" :style="{background:mainColor }" @click="determine()">
<text>确定</text>
</view>
</view>
</view>
</u-popup>
</view>
</view>
</template>
<script>
export default {
data() {
return {
pageTitle: "店铺价格设置",
contentHeight:0,
mainColor:'',
secondary:'',
getSmallGPrice:{},
ISpopup:false,
showmodel:false,
array:[
{type:1,Name:'百分比'},{type:2,Name:'固定金额'}
],
editMsg:{},
value:'',
g:[],
page_count:1,
status: "loadmore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
msg:{
pageIndex: 1,
pageSize:10,
GoodsId:'',
GoodsName:'',
},
show:false,
cHeight:0
}
},
onLoad(){
},
created(){
this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
this.cHeight = this.$uiConfig.is_bang ? 80 : 52;
this.mainColor = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
this.getSmallShopsGlobalPrice()
},
mounted() {
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length-1].route;
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
methods: {
getSmallShopsGlobalPrice(type=1){
uni.showLoading({
title: '加载中'
});
this.request2(
{
url: '/api/AppletSmallShops/GetSmallShopsGlobalPrice',
data: {}
},
(res) => {
this.getSmallGPrice = res.data;
if(this.getSmallGPrice.PriceType ==1){
this.value = '百分比'
}else if(this.getSmallGPrice.PriceType ==2){
this.value = '固定金额'
}
}
);
if(type==1){
this.getSmallShopsGoodsPricePageList()
}else{
uni.hideLoading();
}
},
getSmallShopsGoodsPricePageList(type=1){
if(type==2){
this.msg.GoodsId='';
this.msg.GoodsName='';
this.msg.pageIndex=1;
this.g=[]
}
this.request2(
{
url: '/api/AppletSmallShops/GetSmallShopsGoodsPricePageList',
data: this.msg
},
(res) => {
uni.hideLoading();
let data = res.data.pageData
data.forEach(x=>{
x.showdetail = false
})
this.g = this.g.concat(data);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
}
}
);
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
},
isdetail(index,index2){
if(index2==0){
this.g[index].showdetail = !this.g[index].showdetail;
this.$forceUpdate()
}
},
popupAll(){
this.ISpopup = true;
this.editMsg = JSON.parse(JSON.stringify(this.getSmallGPrice));
if(this.editMsg.UpPrice==null){
this.editMsg.UpPrice = 0
}
},
radioChange(item){
this.editMsg.PriceType = item.type;
this.value = item.Name
this.showmodel =false
},
define(){
let msg ={
UpPrice:0,
PriceType:0
}
msg.UpPrice = this.editMsg.UpPrice;
msg.PriceType = this.editMsg.PriceType;
this.request2(
{
url: '/api/AppletSmallShops/SetSmallShopsGlobalPrice',
data: msg
},
(res) => {
uni.showToast({
title: res.message,
icon: "none",
});
this.getSmallShopsGlobalPrice(2)
this.ISpopup = false;
}
);
},
addShop(){
uni.navigateTo({
url:'/pages/microShop/storeManagement/addGoods'
});
},
goreset(){//重置
this.show=false;
this.msg.GoodsId='';
this.msg.GoodsName='';
this.msg.pageIndex=1;
this.g=[]
this.getSmallShopsGoodsPricePageList()
},
determine(){//确认
this.show=false
this.msg.pageIndex=1;
this.g=[]
this.getSmallShopsGoodsPricePageList()
},
itemEdit(item){
let data = encodeURIComponent(JSON.stringify(item))
uni.navigateTo({
url:'/pages/microShop/storeManagement/goodsEdit?data='+data+'&type=1'
});
}
}
}
</script>
<style>
.storeManagementStyle{
background: #f3f4f6;
}
.storeManagementStyle .overallSet{
width: 100%;
background: #FFF;
display: flex;
flex-direction: column;
align-items: center;
margin-top: 10px;
}
.storeManagementStyle .overallSet_top{
/* padding: 15px 0; */
width: 94%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.storeManagementStyle .topflex{
display: flex;flex-direction: row;align-items: center;
font-size: 14px;
color: #08090E;
}
.storeManagementStyle .allEdit{
width: 60px;
height: 24px;
border-radius: 12px;
background: #FF4048;
display: flex;
align-items: center;
justify-content: center;
color: #FFFFFF
}
.storeManagementStyle .overallSet_center{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
/* padding: 15px 0; */
width: 94%;
}
.storeManagementStyle .listbox{
width: 100%;
margin-bottom: 10px;
padding: 15px;
background: #fff;
display: flex;
flex-direction: column;
align-items: center
}
.storeManagementStyle .popupbox_t{
width: 100%;
border-radius: 10px;
background: #FFF;
display: flex;
flex-direction: column;
align-items: center;
padding: 10px;
position: relative;
}
.storeManagementStyle .box_c{
display: flex;
flex-direction: row;
width: 100%;
overflow: hidden;
margin-top: 15px;
}
.storeManagementStyle .box_c_name{
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
font-size: 13px;
color: #111111;
}
.storeManagementStyle .box_r_b{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-top: 3px;
}
.storeManagementStyle .OrderNoStyle{
width: 100%;
height: 35px;
background: #F8F6F5;
display: flex;
flex-direction: row;
align-items: center;
font-size: 11px;
color: #888888;
margin-top: 15px;
}
.storeManagementStyle .SupplierListstyle{
width: 100%;
background: #F8F6F5;
display: flex;
flex-direction: column;
align-items: center;
margin-top: 10px;
}
.storeManagementStyle .Sitem{
width: 96%;
display: flex;
flex-direction: row;
align-items: center;
font-size: 11px;
color: #888888;
height: 35px;
margin-left: 2%;
}
.storeManagementStyle .Sitem_gg{
width: 50%;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
line-clamp: 1;
-webkit-box-orient: vertical;
}
.Sitem_k{
width: 25%;
text-align: center
}
.storeManagementStyle .popupbox{
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
position: relative;
}
.storeManagementStyle .popupbox_text{
font-size: 12px;
color: #111111;
margin-left: 5%;
}
.storeManagementStyle .popup_item{
width: 90%;
height: 40px;
margin-left: 5%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 5px;
margin-top: 10px;
background: #F8F6F5;
}
.storeManagementStyle .inputM{
width: 100%;
}
.storeManagementStyle .popup_b{
width: 100%;
position: absolute;
left: 0;
bottom: 0;
display: flex;
flex-direction: row;
align-items: center;
color: #FFFFFF;
}
.storeManagementStyle .popup_b_item{
width: 50%;
height: 100%;
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: center;
font-size: 14px;
padding-top: 15px;
}
.storeManagementStyle .popupBox_tr{
width: 100%;
padding-bottom: 15px;
}
.storeManagementStyle .popupBox_tr .popup_top{
width: 100%;
height: 45px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 0 15px;
}
.storeManagementStyle .typeitem{
padding: 15px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border-top:1px solid #f5f5f5
}
</style>
<template>
</template>
<script>
</script>
<style>
</style>
<template>
<view class="cashStyle" :style="{'height':contentHeight}">
<view class="cashBox">
<view class="cashBox_top">
<text style="font-size: 12px;">账户剩余余额</text>
<view style="display: flex;flex-direction: row;align-items: flex-end;">
<text style="font-size: 30px;">{{cash.CommissionWithdrawal}}</text>
<text style="font-size: 15px;margin-left: 5px;"></text>
</view>
<view style="display: flex;flex-direction: row;align-items: center;justify-content: space-between;">
<text style="font-size: 12px;">今日剩余提现金额:{{cash.CanRemitMoney==-1?'无限制':cash.CanRemitMoney+'元'}}</text>
<view style="display: flex;flex-direction: row;" @click="showagreement()">
<text style="font-size: 12px;margin-right: 2px;">规则</text>
<u-icon name="warning-o" size="24" color="#ffffff"></u-icon>
</view>
</view>
<!-- <Text style='font-size: 18px;margin-top: 10px;'>账户剩余余额:{{cash.CommissionWithdrawal}}</Text>
<Text style='font-size: 14px;color:#333 ;margin-top: 10px;'>今日剩余提现金额:{{cash.CanRemitMoney==-1?'不限':cash.CanRemitMoney+'元'}}</Text>
<Text style='font-size: 14px;color:#333 ;margin-top: 10px;'>最少提现额度:{{cash.MinimumWithdrawalLimit}}</Text>
<Text style='font-size: 14px;color:#333 ;margin-top: 10px;'>手续费:{{cash.WithdrawFee}}%</Text> -->
</view>
<view class="tixian" style="margin-top: 10px;">
<text>提现金额</text>
</view>
<view class="tixian" style="background: #F7F5F5;padding: 0 20px;">
<text style='font-size: 12px;color: #FF3F47;'><Text style='font-size: 18px;color:#000000;margin-left: 5px;'>{{cash.CommissionWithdrawal}}</Text> </text>
</view>
<Text style='font-size: 14px;color:#333 ;margin: 10px 0;display: inline-block;width: 94%;'>手续费扣除:{{msg.Fee}}</Text>
<view class="txmode">
<Text>提现方式</Text>
<view @click="show=true" style="width: 200px;display: flex;flex-direction: row;align-items: center;justify-content: flex-end;">
<Text>{{txmode}}</Text>
<u-icon name="arrow" color='#9F9F9F'></u-icon>
</view>
</view>
<view class='inputbox' v-if='txmode!="" && (msg.WithdrawalWay==2 || msg.WithdrawalWay==3 || msg.WithdrawalWay==4)'>
<view class="inputItem">
<!-- <Text v-if='msg.WithdrawalWay==1'>账户名称</Text> -->
<Text v-if='msg.WithdrawalWay==2'>微信名称</Text>
<Text v-if='msg.WithdrawalWay==3'>支付宝名称</Text>
<Text v-if='msg.WithdrawalWay==4'>账户名称</Text>
<!-- <Text v-if='msg.WithdrawalWay==5'>账户名称</Text> -->
<input class="uni-input inputM" v-model="msg.AccountName" />
</view>
<view class="inputItem">
<!-- <Text v-if='msg.WithdrawalWay==1'>账户名称</Text> -->
<Text v-if='msg.WithdrawalWay==2'>微信账号</Text>
<Text v-if='msg.WithdrawalWay==3'>支付宝账号</Text>
<Text v-if='msg.WithdrawalWay==4'>账户号</Text>
<!-- <Text v-if='msg.WithdrawalWay==5'>账户名称</Text> -->
<input class="uni-input inputM" v-model="msg.AccountNumber" />
</view>
<view class="inputItem" v-if="msg.WithdrawalWay==4">
<Text>银行名称</Text>
<input class="uni-input inputM" v-model="msg.BankName" />
</view>
</view>
<View class='getapply' :style="{background:mainColor}" v-if='prohibit==false' @click='getapply'>
<Text>提交申请</Text>
</View>
<View class='getapply' style="background:#999999" v-if='prohibit==true' >
<Text>提交申请</Text>
</View>
</view>
<template>
<u-popup v-model="show"
mode="bottom"
border-radius="16"
>
<view class="popupBox">
<view class="popup_top">
<view></view>
<Text>提现方式</Text>
<u-icon name="cross" color='#9F9F9F' @click='show=false' size="40"></u-icon>
</view>
<view class="txtype">
<view class="typeitem" v-for="(item, index) in list" :key="index" >
<Text>{{item.Name}}</Text>
<u-radio-group v-model="value">
<u-radio
v-model = 'item.checked'
:active-color="mainColor"
shape="circle"
:name="item.Name"
@change="radioChange(item)"
>
</u-radio>
</u-radio-group>
</view>
</view>
</view>
</u-popup>
<view class="agreementbox" v-if='isshowagreement==true'></view>
<view class="agreementbox_t" v-if='isshowagreement==true'>
<view class="agreement_b">
<Text style='height: 40px;line-height: 40px;'>规则</Text>
<view style="width: 100%;height: 760rpx;padding: 20rpx;display: flex;flex-direction: column;">
<text style="font-size: 12px;">今日剩余提现金额:{{cash.CanRemitMoney==-1?'无限制':cash.CanRemitMoney+'元'}}</text>
<Text style='font-size: 14px;color:#333 ;margin-top: 10px;'>最少提现额度:{{cash.MinimumWithdrawalLimit}}</Text>
<Text style='font-size: 14px;color:#333 ;margin-top: 10px;'>手续费:{{cash.WithdrawFee}}%</Text>
</view>
<view class="agreement_bottom" :style="{background:mainColor}" @click="read">
<Text style='color: #fff;'>确定</Text>
</view>
</view>
</view>
</template>
</view>
</template>
<script>
export default {
data() {
return {
pageTitle: "提现明细",
contentHeight:0,
mainColor:'',
secondary:'',
cash:{},
money:0,
isshowagreement:false,
txmode:'',
show:false,
show2:false,
list: [
{
Name: '微信零钱',
checked: false,
},
],
value:'',
msg:{
AppliedMoney:'',
Fee:0,
RemitMoney:0,
WithdrawalWay:'',
AccountName:'',
AccountNumber:'',
BankName:'',
},
prohibit:false,
}
},
onLoad(option){
},
created(){
this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
this.mainColor = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
this.init()
},
mounted() {
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length-1].route;
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
methods: {
init(){
uni.showNavigationBarLoading();
this.request2(
{
url: '/api/AppletUser/GetUserDistrbutorWithdrawDepositBalance',
data: {}
},
(res) => {
uni.hideNavigationBarLoading()
this.cash = res.data;
let WayList = res.data.WithdrawWayList;
WayList.forEach((x)=>{
x.checked = false
})
this.list = WayList
this.msg.AppliedMoney = Number(this.cash.CommissionWithdrawal)
this.msg.Fee = (Number(this.cash.WithdrawFee*0.01*this.msg.AppliedMoney)).toFixed(2);
}
);
},
allmoney(){
// this.msg.AppliedMoney = Number(this.cash.CommissionWithdrawal)
// this.msg.Fee = (Number(this.cash.WithdrawFee*0.01*this.msg.AppliedMoney)).toFixed(2);
},
liedMoney(val){
this.msg.AppliedMoney = Number(val.target.value)
this.msg.Fee = (Number(this.cash.WithdrawFee*0.01*this.msg.AppliedMoney)).toFixed(2);
},
radioChange(item){
this.txmode = item.Name;
this.msg.WithdrawalWay = item.Id;
this.msg.AccountName = '';
this.msg.AccountNumber = '';
this.msg.BankName = '';
this.show=false
},
showagreement(){
this.isshowagreement = true
},
read(){
this.isshowagreement = false
},
getapply(){
let that = this
uni.requestSubscribeMessage({
tmplIds: that.cash.template_message_list,
complete (res) {
console.log(that.msg.AppliedMoney)
if(that.msg.AppliedMoney<0){
uni.showToast({
title: "请输入提现金额",
icon: "none"
});
return false
}
if(that.txmode==''){
uni.showToast({
title: "请选择提现方式",
icon: "none"
});
return false
}
if(that.msg.WithdrawalWay==2|| that.msg.WithdrawalWay==3 || that.msg.WithdrawalWay==4){
if(that.msg.AccountName==''){
uni.showToast({
title: "账户名称不能为空",
icon: "none"
});
return false
}
if(that.msg.AccountNumber==''){
uni.showToast({
title: "账户号不能为空",
icon: "none"
});
return false
}
if(that.msg.BankName=='' && that.msg.WithdrawalWay==4){
uni.showToast({
title: "银行名称不能为空",
icon: "none"
});
return false
}
}
if(that.cash.MinimumWithdrawalLimit!=-1){
if(that.msg.AppliedMoney<that.cash.MinimumWithdrawalLimit){
uni.showToast({
title: "提现金额大于等于"+that.cash.MinimumWithdrawalLimit,
icon: "none"
});
return false
}
}
if(that.msg.AppliedMoney>that.cash.CommissionWithdrawal){
uni.showToast({
title: '余额不足',
icon: "none"
});
return false
}
that.msg.Fee = Number(that.msg.Fee);
that.msg.RemitMoney = that.msg.AppliedMoney - that.msg.Fee; //最终提现要减去 手续费
uni.showLoading({
title:'加载中',
icon:'none'
})
that.prohibit = true;//禁止接口没回来时候的再次操作
that.request2(
{
url: '/api/AppletUser/SetUserDistrbutorWithdrawDeposit',
data: that.msg
},
(res) => {
that.prohibit = false
uni.hideLoading()
uni.showToast({
title: res.message,
icon: "none"
});
that.init()
uni.navigateTo({
url: '/pages/cash-detail/cash-detail'
});
},
(err)=>{
that.prohibit = false
}
);
}
})
}
}
}
</script>
<style>
.cashStyle{
background: #FFFFFF;
}
.cashStyle .cashBox{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.cashStyle .cashBox .cashBox_top{
width: 94%;
height: 130px;
display: flex;
flex-direction: column;
background-image: url(../../static/images/shareTop.png);
background-repeat: no-repeat;
background-size: 100% 100%;
padding:20px;
color: #FFFFFF;
border-radius: 6px;
justify-content: space-between;
}
.cashStyle .rule{
width: 40px;
height: 24px;
border-radius: 12px;
font-size: 12px;
border:1px solid #ff4544;
display: flex;
align-items: center;
justify-content: center;
margin-left: 5px;
}
.cashStyle .tixian{
width: 94%;
height: 40px;
display: flex;
flex-direction: row;
align-items: center;
color: #000000;
font-weight: 500;
font-size: 14px;
}
.cashStyle .txmode{
width: 100%;
height: 70px;
padding:0 15px;
background: #fff;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
/* margin-top: 20px; */
}
.cashStyle .getapply{
width: 94%;
height: 45px;
border-radius: 22.5px;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
margin-top: 20px;
}
.cashStyle .popupBox{
width: 100%;
padding-bottom: 15px;
}
.popupBox .popup_top{
width: 100%;
height: 45px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 0 15px;
}
.popupBox .txtype{
}
.cashStyle .typeitem{
padding: 15px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border-top:1px solid #f5f5f5
}
.cashStyle .inputbox{
width: 100%;
background: #fff;
display: flex;
flex-direction: column;
align-items: center;
margin-top: 10px;
padding:0 15px ;
}
.cashStyle .inputItem{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
align-items: center;
padding: 15px 0;
border-bottom: 1px solid #f5f5f5;
}
.cashStyle .inputM{
text-align: right;
}
.cashStyle .agreementbox{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: #333333;
opacity: 0.3;
z-index: 888;
}
.cashStyle .agreementbox_t{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 999;
display: flex;
align-items: center;
justify-content: center;
}
.cashStyle .agreementbox_t .agreement_b{
width:80% ;
border-radius: 10px;
background: #fff;
display: flex;
flex-direction: column;
align-items: center;
overflow: hidden;
}
.cashStyle .agreementbox_t .agreement_bottom{
width: 100%;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
}
</style>
<template>
<view class="wdOrderStyle" :style="{'height':contentHeight}">
<view style="width: 100%;height: 100%;">
<u-tabs :list="list" :is-scroll="false" :current="msg.DistrbutionOrderSelectStatus" @change="change" :active-color='mainColor' ></u-tabs>
<u-empty v-if="g.length==0" text="暂无数据" mode="data"></u-empty>
<template v-if="g.length > 0">
<view
style="
height: calc(100vh - 50px);
width: calc(100vw);
overflow: hidden;
padding: 10px 0;
">
<scroll-view
:scroll-y="true"
:enable-back-to-top="true"
:enable-flex="true"
@scrolltolower="lower"
:style="{ height: '100%' }">
<view style="display: flex;flex-direction: column;align-items: center;">
<view v-for="(item, index) in g" :key="index" class="listbox">
<view class="box_top">
<Text style='font-size: 14px;'>订单号:{{item.OrderNo}}</Text>
<Text :style="{'font-size':'14px','color':mainColor}">{{item.StatusName}}</Text>
</view>
<view class="box_center" @click="isdetail(index)">
<view class="center_l" >
<u-avatar :src="item.Photo" mode="square" size="70"></u-avatar>
<view class="box_ltext">
<Text class='l_name'>{{item.UserName}}</Text>
</view>
<!-- <Text v-if='item.Grade==0'>自购返佣</Text>
<Text v-if='item.Grade==1'>一级分销</Text>
<Text v-if='item.Grade==2'>二级分销</Text> -->
<text style="margin-left: 15px;">{{item.GradeDescription}}</text>
</view>
<view class="center_l">
<Text>{{item.CommissionState==1? '待返佣':'已返佣'}}<Text :style="{color:mainColor}">{{item.Commission}}</Text></Text>
<u-icon name="arrow" v-if='item.showdetail==false'></u-icon>
<u-icon name="arrow-down" v-if='item.showdetail==true'></u-icon>
</view>
</view>
<view style="display: flex;flex-direction: column;align-items: center;padding-bottom: 15px;width: 100%;" v-if='item.showdetail==true'>
<view class="box_bottom" v-for="(c, i) in item.DetailList" :key="i">
<image :src="c.CoverImagePath" style="width: 55px;height: 55px" mode='aspectFit'></image>
<view class="b_r">
<Text class='l_name'>{{c.GoodsName}}</Text>
<view style='display: flex;flex-direction: row;align-items: center;'>
<Text v-for="(q, w) in c.SpecificationList" :key="w">{{q}}</Text>
</view>
<view>
<Text :style="{color:mainColor}">¥{{c.Final_Price}}</Text>
<Text style='margin-left: 5px;'>x{{c.Number}}</Text>
</view>
</view>
</view>
</view>
</view>
</view>
<u-loadmore
:status="status"
:load-text="loadText"
:font-size="24"
:margin-top="20"
:margin-bottom="20"
bg-color="#f3f4f6"
/>
</scroll-view>
</view>
</template>
</view>
</view>
</template>
<script>
export default {
data() {
return {
pageTitle: "分销订单",
contentHeight:0,
mainColor:'',
secondary:'',
g:[],
list:[
{name: '全部'},
{name: '待付款'},
{name: '已付款'},
{name: '已完成'},
],
msg:{
pageIndex: 1,
pageSize:10,
DistrbutionOrderSelectStatus:0
},
page_count:1,
status: "loadmore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
}
},
created(){
this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
this.mainColor = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
this.init()
},
mounted() {
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length-1].route;
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
methods: {
init(){
uni.showLoading({
title: '加载中'
});
this.request2(
{
url: '/api/AppletUser/GetSmallShopsCommissionPageList',
data: this.msg
},
(res) => {
uni.hideLoading();
let list = res.data.pageData;
list.forEach((x)=>{
x.showdetail = false
})
this.g = this.g.concat(list);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
}
}
);
},
change(index){
this.msg.DistrbutionOrderSelectStatus = index;
this.msg.pageIndex=1;
this.g=[]
this.init()
},
isdetail(index){
this.g[index].showdetail = !this.g[index].showdetail
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
},
}
}
</script>
<style>
.wdOrderStyle{
background: #f3f4f6;
}
.wdOrderStyle .listbox{
width: 100%;
background: #fff;
padding: 0 15px;
margin-bottom: 15px;
display: flex;
flex-direction: column;
align-items: center;
}
.wdOrderStyle .listbox .box_top{
width: 100%;
height: 45px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #f5f5f5;
}
.wdOrderStyle .listbox .box_center{
width: 100%;
height: 45px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
font-size: 13px;
}
.wdOrderStyle .center_l{
display: flex;flex-direction: row;align-items: center;
}
.wdOrderStyle .listbox .box_ltext{
width: 90px;
margin-left: 5px;
}
.wdOrderStyle .listbox .l_name{
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.wdOrderStyle .listbox .box_bottom{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 15px 0 0;
border-top: 1px solid #f5f5f5;
font-size: 13px;
}
.box_bottom .b_r{
width: calc(100vw - 30px - 50px - 20px);
display: flex;
flex-direction: column;
justify-content: space-between;
}
</style>
<template>
<view class="wdWithdrawalStyle" :style="{'height':contentHeight}">
<view style="width: 100%;height: 100%;">
<u-tabs :list="list" :is-scroll="false" :current="msg.AuditStatus" @change="change" :active-color='mainColor' bg-color='#f3f4f6'></u-tabs>
<u-empty v-if="g.length==0" text="暂无数据" mode="data"></u-empty>
<template v-if="g.length > 0">
<view
style="
height: calc(100vh - 50px);
width: calc(100vw);
overflow: hidden;
padding: 10px 0;
">
<scroll-view
:scroll-y="true"
:enable-back-to-top="true"
:enable-flex="true"
@scrolltolower="lower"
:style="{ height: '100%' }">
<view style="display: flex;flex-direction: column;align-items: center;">
<view v-for="(item, index) in g" :key="index" class="listbox">
<!-- <view style="padding: 10px;color: #999;">{{item.date}}</view> -->
<!-- <view class="box_b" v-for="(c, i) in item.list" :key="i"> -->
<view class="box_b" >
<view class="box_b_l">
<view style='display: flex;flex-direction: row;align-items: center;'>
<Text>{{item.WithdrawalWayName}}</Text>
<view class="status">
<Text :style="{'color':mainColor}">{{item.AuditStatusName}}</Text>
</view>
</view>
<Text class='text_s' v-if='item.WithdrawalWay==1'>提现方式:自动打款</Text>
<Text class='text_s' v-if='item.WithdrawalWay==2'>提现方式:微信线下转账</Text>
<Text class='text_s' v-if='item.WithdrawalWay==3'>提现方式:支付宝线下转账</Text>
<Text class='text_s' v-if='item.WithdrawalWay==4'>提现方式:银行卡线下转账</Text>
<Text class='text_s' v-if='item.WithdrawalWay==5'>提现方式:余额提现</Text>
<Text class='text_s'>提现时间:{{item.RemitDate}}</Text>
</view>
<view class="box_b_l" style="align-items: flex-end;">
<Text style='font-size: 18px;'>{{item.AppliedMoney}}</Text>
<Text class='text_s' > 手续费{{item.Fee}}</Text>
</view>
</view>
</view>
</view>
<u-loadmore
:status="status"
:load-text="loadText"
:font-size="24"
:margin-top="20"
:margin-bottom="20"
bg-color="#f3f4f6"
/>
</scroll-view>
</view>
</template>
</view>
</view>
</template>
<script>
export default {
data() {
return {
pageTitle: "提现明细",
contentHeight:0,
mainColor:'',
secondary:'',
g:[],
list:[
{name: '全部'},
{name: '待审核'},
{name: '待打款'},
{name: '已打款'},
{name: '无效'},
],
msg:{
pageIndex: 1,
pageSize:10,
AuditStatus:0
},
page_count:1,
status: "loadmore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
}
},
created(){
this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
this.mainColor = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
this.init()
},
mounted() {
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length-1].route;
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
methods: {
init(){
uni.showLoading({
title: '加载中'
});
this.request2(
{
url: '/api/AppletUser/GetSmallShopsRemitPageList',
data: this.msg
},
(res) => {
uni.hideLoading();
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
}
}
);
},
change(index){
this.msg.AuditStatus = index;
this.msg.pageIndex=1;
this.g=[]
this.init()
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
},
}
}
</script>
<style>
.wdWithdrawalStyle{
background: #f3f4f6;
}
.wdWithdrawalStyle .listbox{
width: 94%;
border-radius: 10rpx;
background: #fff;
margin-top: 15px;
}
.wdWithdrawalStyle .listbox .box_b{
width: 100%;
padding: 10px;
/* border-top: 1px solid #f5f5f5; */
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.listbox .box_b .box_b_l{
display: flex;
flex-direction: column;
}
.box_b .box_b_l .status{
height:20px ;
padding: 0 5px;
border: 1px solid #ff4544;
display: flex;
align-items: center;
justify-content: center;
border-radius: 10px;
margin-left: 5px;
font-size: 14px;
}
.wdWithdrawalStyle .text_s{
font-size: 14px;
color: #999999;
margin-top: 3px;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment