shop_uniapp/bundle/pages/user_spread/user_spread.vue
2024-11-30 17:09:25 +08:00

1304 lines
34 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view>
<loading-view v-if="showLoading"></loading-view>
<u-notice-bar :show="showTips" mode="horizontal" :list="list" :font-size="28" :close-icon="true" :speed="100"
@close="showTips=false" color="#449FFB"></u-notice-bar>
<view class="user-spread">
<view class="header p-t-40 m-b-50">
<view class="user-info flex m-l-30">
<view class="user-avatar">
<u-image width="110rpx" height="110rpx" border-radius="60" :src="userInfo.procurement.avatar" />
</view>
<view class="user-message m-l-20 white">
<view class="m-b-10">
<view class="xxl bold m-r-20">{{userInfo.user.nickname}}</view>
</view>
<view class="avatar-tag white xxs text-center m-b-10" v-if="distributionInfo.level_name">
{{distributionInfo.level_name}}</view>
<view class="xs flex">
上级分销商:{{userInfo.leader.nickname ? userInfo.leader.nickname : '东龙汇'}}
<view v-if="!userInfo.leader.nickname"
class="br60 white write-btn flex row-center m-l-30 xxs" @tap="showInvitePop">填写
</view>
</view>
</view>
</view>
</view>
<view class="main">
<!-- 填表格 -->
<view v-if="vipState == 0" class="user-apply-box">
<view class="user-apply-vip flex-col col-center">
<view class="user-apply-header flex-col col-center">
<view class="title xxl normal">申请成为分销会员</view>
</view>
<view class="vip-form">
<view class="form-item">
<router-link to="/bundle_b/pages/city/scheme_city">
<u-field label="合伙人:" label-width="160" placeholder="请选择所属城市" :border-bottom="false" v-mode="city"
disabled :value="scheme_city.name" />
</router-link>
<view v-if="scheme_city != '' && city_data" class="open-shop">
<view class="open-category">
<view v-for="(item, index) in city_data" :key="index"
:class="'open-item ' + ((partnerIndex == index ) ? 'active': '') + ' '"
@click="selectPartner(index)">
<view class="bold text-center">
{{item.partner}}
</view>
<view class="m-t-20">
<view class="m-t-10 text-left">金额:<text class="bold">¥{{item.money}}</text></view>
<!-- <view class="m-t-10 text-left">比例:{{item.proportion}}</view> -->
</view>
</view>
</view>
</view>
</view>
<view class="form-item">
<u-field v-model="realName" :label-width="150" label="真实姓名:" :border-bottom="false"
placeholder="请输入您的真实姓名">
</u-field>
</view>
<view class="form-item">
<u-field v-model="mobile" :label-width="150" label="手机号码:" :border-bottom="false"
placeholder="请输入您的手机号码">
</u-field>
</view>
<view class="form-item">
<u-field label="身份证正面" label-width="160" placeholder="请上传身份证正面" :border-bottom="false"
disabled />
<view class="apply-form-upload" @click="uploadFrontCard" v-if="front_id_card">
<image :src="front_id_card" mode="aspectFit"></image>
</view>
<view class="apply-form-upload" @click="uploadFrontCard" v-else>
<u-icon name="plus" color="#e2e2e2" size="48" top="28"></u-icon>
</view>
</view>
<view class="form-item">
<u-field label="身份证反面" label-width="160" placeholder="请上传身份证反面" :border-bottom="false"
disabled />
<view class="apply-form-upload" @click="uploadBackCard" v-if="back_id_card">
<image :src="back_id_card" mode="aspectFit"></image>
</view>
<view class="apply-form-upload" @click="uploadBackCard" v-else>
<u-icon name="plus" color="#e2e2e2" size="48" top="28"></u-icon>
</view>
</view>
<view class="form-item">
<u-field label="手持身份证" label-width="160" placeholder="请上传手持身份证" :border-bottom="false"
disabled />
<view class="apply-form-upload" @click="uploadHandCard" v-if="hand_id_card">
<image :src="hand_id_card" mode="aspectFit"></image>
</view>
<view class="apply-form-upload" @click="uploadHandCard" v-else>
<u-icon name="plus" color="#e2e2e2" size="48" top="28"></u-icon>
</view>
</view>
<!-- <view class="form-item">
<u-field label="消费截图" label-width="160" placeholder="请上传消费截图" :border-bottom="false"
disabled />
<view class="apply-form-upload" @click="uploadCostCard" v-if="cost_card">
<image :src="cost_card" mode="aspectFit"></image>
</view>
<view class="apply-form-upload" @click="uploadCostCard" v-else>
<u-icon name="plus" color="#e2e2e2" size="48" top="28"></u-icon>
</view>
</view> -->
<view class="form-item" @tap="showRegion=true">
<u-field v-model="region" disabled right-icon="arrow-right" :label-width="150"
label="现住省份:" :border-bottom="false" placeholder="请选择省、市、区">
</u-field>
</view>
<view class="form-item open-shop" v-if="scheme.store_type_status == 1">
<u-checkbox @change="changeOpenShop" v-model="open_shop" shape="circle">
<text style="font-size: 28rpx;">是否开店</text>
</u-checkbox>
<view v-if="open_shop && scheme.store_type.length > 0" class="open-category m-t-20">
<view v-for="(item, index) in scheme.store_type" @click="openStore(index)" :key="index" :class="'open-item ' + ((selectStore == index ) ? 'active': '') + ' '">
<view>{{item.title}}</view>
<view class="m-t-10 text-left">金额:<text class="bold">¥{{item.money}}</text></view>
</view>
</view>
</view>
<view class="form-item">
<u-field v-model="reason" :label-width="150" type="textarea" label="申请原因:"
placeholder="(必填)" :field-style="{ height: '250rpx'}" />
</view>
</view>
</view>
<view class="m-t-30 sm flex row-center">
<u-checkbox v-model="isAgreement" shape="circle">
<div class="flex">
已阅读并同意
<router-link
to="/bundle/pages/server_explan/server_explan?type=7"
>
<view class="primary">《分销推广协议》</view>
</router-link>
</div>
</u-checkbox>
</view>
<button class="apply-btn bg-primary white md m-t-20 flex row-center br60" @tap="formSubmit">
立即申请
</button>
<view class="m-t-20 bold lighter flex row-center">此次消费将参与消费返补!</view>
<view class="p-b-20 xxs lighter flex row-center">提交成功后,我们将会在1-2个工作日内给您回复</view>
</view>
<!-- 申请状态 -->
<view v-if="vipState==1" class="user-result-box">
<view class="user-result flex-col col-center">
<view class="user-result-header flex-col col-center">
<view class="title xxl normal">申请成为分销会员</view>
</view>
<view class="user-result-content flex-col col-center">
<image class="apply-result-img"
:src="applyObject.status == 2 ? 'https://zjeloong.oss-cn-hangzhou.aliyuncs.com/uniapp/icon_fail.png' : 'https://zjeloong.oss-cn-hangzhou.aliyuncs.com/uniapp/icon_success.png'" />
<view class="m-t-10 nr" style="line-height: 40rpx">{{applyObject.status_str}}</view>
<view class="apply-fail-reason sm"
:style="applyObject == 2 ? 'visibility: none' : 'visibility: hidden'">
{{applyObject.reason}}
</view>
<view class="m-t-10" v-if="applyObject.status == 2 && applyObject.denial_reason">
{{applyObject.denial_reason}}
</view>
</view>
<view class="user-result-info">
<view class="info-item flex nr">
<view class="label">真实姓名:</view>
<view class="info-text ml20">{{applyObject.real_name}}</view>
</view>
<view class="info-item flex nr">
<view class="label">手机号码:</view>
<view class="info-text ml20">{{applyObject.mobile}}</view>
</view>
<view class="info-item flex nr">
<view class="label">现住省份:</view>
<view class="info-text ml20">{{applyObject.province}} {{applyObject.city}}
{{applyObject.district}}
</view>
</view>
<view class="info-item flex nr" v-if="applyObject.front_id_card">
<view class="label">身份证正面:</view>
<u-image width="100rpx" height="200rpx" mode="aspectFit"
:src="applyObject.front_id_card"></u-image>
</view>
<view class="info-item flex nr" v-if="applyObject.back_id_card">
<view class="label">身份证反面:</view>
<u-image width="100rpx" height="200rpx" mode="aspectFit"
:src="applyObject.back_id_card"></u-image>
</view>
<view class="info-item flex nr" v-if="applyObject.hand_id_card">
<view class="label">手持照片:</view>
<u-image width="100rpx" height="200rpx" mode="aspectFit"
:src="applyObject.hand_id_card"></u-image>
</view>
<!-- <view class="info-item flex nr" v-if="applyObject.hand_id_card">
<view class="label">消费截图:</view>
<u-image width="300rpx" height="300rpx" mode="widthFix"
:src="applyObject.cost_card"></u-image>
</view> -->
<view class="info-item flex nr">
<view class="label">申请原因:</view>
<view class="info-text ml20">{{applyObject.reason ? applyObject.reason : '-'}}</view>
</view>
<view class="info-item flex nr">
<view class="label">所属城市:</view>
<view class="info-text ml20">{{applyObject.own_city}}</view>
</view>
<view class="info-item flex nr" v-if="applyObject.partner">
<view class="label">合伙人类型:</view>
<view>
<view class="info-text ml20">{{applyObject.partner}}</view>
<view class="m-t-10 text-left">金额:<text class="bold">¥{{applyObject.partner_money}}</text></view>
</view>
</view>
<view class="info-item flex nr" v-if="applyObject.store">
<view class="label">店铺类型:</view>
<view>
<view class="info-text ml20">{{applyObject.store.title}}</view>
<view class="m-t-10 text-left">金额:<text class="bold">¥{{applyObject.store.money}}</text></view>
</view>
</view>
</view>
</view>
<view :class="'white m-t-20 br60 apply-btn flex row-center md bg-primary'" v-if="applyObject.status == 2" @tap="reApply">重新申请
</view>
<view class="m-t-20 bold lighter flex row-center">此次消费将参与消费返补!</view>
<view class="p-b-20 xxs lighter flex row-center">提交成功后,我们将会在1-2个工作日内给您回复</view>
</view>
<!-- 已申请 -->
<view v-if="vipState==2" class="user-vip">
<view class="user-assets-box">
<view class="user-assets-header flex row-between">
<view class="flex nr bold" style="line-height: 80rpx;color: #8F430E;">
可提现佣金:
<price-format weight="bold" :first-size="36" :subscript-size="26" :second-size="36"
:price="distributionInfo.able_withdrawal" :color="colorConfig.primary" />
</view>
<navigator hover-class="none" class="primary-btn white flex row-center"
url="/bundle/pages/user_withdraw/user_withdraw">立即提现</navigator>
</view>
<view class="user-assets-content flex flex-wrap">
<view class="user-item flex-col col-center">
<tool-tip v-if="false" class="m-t-20" id="today-profit" content="今日预估收益金额"
style="position: absolute;right: -66rpx;"></tool-tip>
<view class="nr user-assets-name flex" style="color: #8F430E">
今日预估收益
<!-- <u-icon class="ml10" name="question-circle" size="30rpx" color="#D88D5A" /> -->
</view>
<view class="assets m-l-20">
<price-format weight="bold" :first-size="36" :subscript-size="26" :second-size="36"
:price="distributionInfo.today_earnings" :color="colorConfig.primary" />
</view>
</view>
<view class="user-item flex-col col-center">
<view class="nr user-assets-name flex" style="color: #8F430E">
本月预估收益
<!-- <u-icon class="ml10" name="question-circle" size="30rpx" color="#D88D5A" /> -->
</view>
<view class="assets m-l-20">
<price-format weight="bold" :first-size="36" :subscript-size="26" :second-size="36"
:price="distributionInfo.month_earnings" :color="colorConfig.primary" />
</view>
</view>
<view class="user-item flex-col col-center">
<view class="nr user-assets-name flex" style="color: #8F430E">
累计获得收益
<!-- <u-icon class="ml10" name="question-circle" size="30rpx" color="#D88D5A" /> -->
</view>
<view class="assets">
<price-format weight="bold" :first-size="36" :subscript-size="26" :second-size="36"
:price="distributionInfo.history_earnings" :color="colorConfig.primary" />
</view>
</view>
</view>
</view>
<view class="mt20 fans-msg-box flex row-between bg-white md">
<router-link class="flex-1" to="/bundle/pages/user_spread_store/user_spread_store">
<view class="my-fans flex row-center normal">
我的推广店铺 <view class="primary m-l-10">{{distributionInfo.shop_fans || 0}}</view>
<u-icon class="m-l-10" name="arrow-right" size="28rpx" color="#666" />
</view>
</router-link>
<router-link class="flex-1" to="/bundle/pages/user_fans/user_fans">
<view class="my-fans flex row-center normal">
我的粉丝 <view class="primary m-l-10">{{distributionInfo.fans}}</view>
<u-icon class="m-l-10" name="arrow-right" size="28rpx" color="#666" />
</view>
</router-link>
</view>
<view class="my-invite-box m-t-20 bg-white flex-col col-center">
<view class="my-invite-title sm normal">我的邀请码</view>
<view>
<image :src="wxImage" class="wxImage"></image>
</view>
<view @click="saveQrcode()" style="text-align: center; margin-top: 20rpx;font-weight: bold;">
点击下载</view>
<view class="flex bold m-t-20" style="font-size: 42rpx;line-height: 30rpx">
{{userInfo.procurement.distribution_code}}
<view class="invite-copy-btn m-l-10 xxs" @click="onCopy">点击复制</view>
</view>
<!-- <view class="row-center my-promote-banner bg-primary white">我的推广海报</view> -->
</view>
<view class="usual-tools-box bg-white m-t-20">
<view class="usual-tools-header flex lg bold">
常用工具
</view>
<view class="usual-content flex">
<!-- <router-link class="usual-item" to="/bundle/pages/user_spread_order/user_spread_order">
<view class="flex-col col-center">
<image src="/bundle/static/icon_fenxiao.png" class="usual-item-img"></image>
<view class="nr normal m-t-20" style="line-height: 40rpx">分销订单</view>
</view>
</router-link> -->
<router-link class="usual-item" to="/bundle/pages/commission_details/commission_details">
<view class="flex-col col-center">
<image src="/bundle/static/icon_yongjin.png" class="usual-item-img"></image>
<view class="nr normal m-t-20" style="line-height: 40rpx">佣金明细</view>
</view>
</router-link>
<!-- <router-link class="usual-item" to="/bundle/pages/monthly_bill/monthly_bill">
<view class="flex-col col-center">
<image src="/bundle/static/icon_zhangdan.png" class="usual-item-img"></image>
<view class="nr normal m-t-20" style="line-height: 40rpx">月度账单</view>
</view>
</router-link> -->
</view>
</view>
</view>
</view>
<u-popup v-model="showPop" mode="center" closeable border-radius="30">
<view class="inviteform-contain flex-col col-center">
<view class="title xl">填写邀请人</view>
<view class="input-row flex">
<view style="width: 140rpx;">邀请码:</view>
<u-input :clearable="false" v-model="inviteCode" placeholder="请输入邀请码"></u-input>
</view>
<view class="btn bg-primary white flex row-center" @tap="bindSuperiorFun">确定</view>
</view>
</u-popup>
<!-- 支付成功 -->
<u-popup class="pay-popup" v-model="successPopup" closeable round mode="center">
<view class="content bg-white">
<image class="img-icon" :src="aliOSS + 'uniapp/icon_success.png'">
</image>
<view class="xxl bold m-t-10">成功支付</view>
<button class="br60 btn" type="primary" size="md" @tap="successPopup = false">好的</button>
</view>
</u-popup>
<!-- 取消支付 -->
<u-popup class="pay-popup" v-model="cancelPopup" closeable round mode="center">
<view class="content bg-white">
<image class="img-icon" :src="aliOSS + 'uniapp/icon_fail.png'">
</image>
<view class="xxl bold m-t-10">您已取消支付</view>
<button class="br60 btn" type="primary" size="md" @tap="cancelPopup = false">好的</button>
</view>
</u-popup>
<u-select v-model="showRegion" mode="mutil-column-auto" @confirm="regionChange" :list="regionLists"></u-select>
</view>
</view>
</template>
<script>
import {
bindSuperior,
applyDistribute,
applyDetail,
getSuperiorInfo,
getDistribution,
veryfiyDistribute,
makeMyWxImage,
getScheme,
distributionPay
} from "@/api/user";
import {
checkReturn,
gh,
wxPay
} from "@/api/local_store";
import area from '@/utils/area'
import {
mapGetters
} from 'vuex';
import {
copy
} from '@/utils/tools'
import {
ossUpload
} from '@/js_sdk/jason-alioss-upload/oss.js'
import {
wxpay
} from '@/utils/pay'
export default {
data() {
return {
list: ['成为分销会员,推广下级可获得额外收益,推广越多收益越多'],
showTips: true,
showLoading: true,
// 弹窗展示
showPop: false,
mobile: '',
realName: '',
id_card: '',
front_id_card: '',
back_id_card: '',
hand_id_card: '',
// cost_card: '',
reason: '',
region: '',
// 省id
provinceId: -1,
// 市id
cityId: -1,
// 区ID
districtId: -1,
// 推销状态 0 ==> 未申请 1 ==> 申请进度 2 ==> 已申请
vipState: 0,
userInfo: {
user: {},
leader: {}
},
// 审核信息对象
applyObject: {},
// 邀请人状态
inviteStatus: false,
showRegion: false,
regionLists: area,
distributionInfo: {},
fileList: [],
wxImage: '',
open_shop: false, //是否开店
selectStore: -1,
scheme: [],
scheme_city: [],
city_data: [],
city: '',
type: '',
partnerIndex: -1,
successPopup: false,
cancelPopup: false,
isAgreement: false
};
},
onLoad(options) {
// 获取店铺类型及合作方案
this.getSchemeFun()
// 获取上级及个人信息
this.getSuperiorInfoFun()
// 判断是否是分销会员
this.veryfiyDistributeFun()
// 获取二维码
this.handleMakeMyWxImage()
// wxPay({
// money: 1,
// }).then((result) => {
// if (result.code == 1) {
// const pay = {
// nonceStr: result.data.nonceStr,
// package: result.data.package,
// paySign: result.data.paySign,
// signType: result.data.signType,
// timeStamp: result.data.timeStamp,
// }
// const alog_id = result.data.alog_id
// this.handleWechatPay(pay, 1, 1);
// }
// })
},
onShow() {
if (this.$store.getters.schemeCity) {
this.scheme_city = this.$store.getters.schemeCity
}
},
methods: {
async handleMakeMyWxImage() {
const {
code,
msg,
data
} = await makeMyWxImage()
if (code == 1) {
this.wxImage = data.wx_image
}
},
// 身份证正面
uploadFrontCard() {
this.uploadImage('front_id_card')
},
// 身份证反面
uploadBackCard() {
this.uploadImage('back_id_card')
},
// 上传手持身份证
uploadHandCard() {
this.uploadImage('hand_id_card')
},
uploadCostCard() {
this.uploadImage('cost_card')
},
uploadImage(type) {
uni.chooseImage({
count: 1,
success: async (file) => {
uni.showLoading({
title: '上传中...'
})
const {
success,
data
} = await ossUpload(file.tempFilePaths[0], file.tempFiles[0].path,
'user_spread_idcard/')
if (success) {
switch(type) {
case 'cost_card':
this.cost_card = data
break;
case 'hand_id_card':
this.hand_id_card = data
break;
case 'back_id_card':
this.back_id_card = data
break;
case 'front_id_card':
this.front_id_card = data
break;
}
uni.hideLoading()
} else {
uni.showToast({
icon: 'none',
title: '上传失败'
})
uni.hideLoading()
}
}
})
},
// 分销会员信息
async getDistributionFun() {
const {
data,
code
} = await getDistribution()
if (code == 1) {
this.showLoading = false
this.distributionInfo = data
}
},
veryfiyDistributeFun() {
veryfiyDistribute().then(res => {
if (res.code == 10001) {
// 分销会员
this.vipState = 2
this.getDistributionFun()
} else if (res.code == 20001) {
// 非分销会员
this.vipState = 0;
this.applyDetailFun()
} else if (res.code == 0) {
// 返回上一页
setTimeout(() => {
uni.navigateBack()
}, 500)
}
})
},
// 最新分销会员申请详情
async applyDetailFun() {
const {
data,
code
} = await applyDetail()
if (code == 1) {
this.showLoading = false
switch (data.status) {
case 0:
// 待审核
case 2:
// 审核不通过
this.vipState = 1;
if (this.$store.getters.schemeCity) {
this.vipState = 0;
}
this.applyObject = data
this.fileList = [{
url: data.hand_id_card
}, ]
break;
}
}
},
reApply() {
this.vipState = 0
},
regionChange(region) {
this.region = region[0].label + " " + region[1].label + " " + region[2].label
this.provinceId = region[0].value;
this.cityId = region[1].value;
this.districtId = region[2].value
},
formClick() {
uni.$u.throttle(this.formSubmit, 500)
},
changeOpenShop(e) {
this.open_shop = e.value
},
async getSchemeFun() {
const {code, data} = await getScheme()
if (code == 1) {
this.scheme = data
}
},
formSubmit() {
let {
provinceId,
cityId,
districtId,
reason,
mobile,
realName,
front_id_card,
back_id_card,
region,
hand_id_card,
// cost_card,
partnerIndex,
selectStore,
city,
isAgreement
} = this
if (!realName) {
this.$toast({
title: "请填写真实姓名"
});
return;
}
if (!mobile) {
this.$toast({
title: "请填写手机号码"
});
return;
}
if (!front_id_card) {
this.$toast({
title: "请上传身份证正面"
});
return;
}
if (!back_id_card) {
this.$toast({
title: "请上传身份证反面"
});
return;
}
if (!hand_id_card) {
this.$toast({
title: "请上传手持身份证照片"
});
return;
}
if (!region.length) {
this.$toast({
title: "请选择省市区"
});
return;
}
if (!reason) {
this.$toast({
title: "请填写申请原因"
});
return;
}
if (!isAgreement) {
this.$toast({
title: "请先勾选分销推广协议"
});
return;
}
// 如果合伙人类型不是普通合伙人就不用支付店铺类型的费用
let money = 0
let partner = []
if (partnerIndex > -1) {
partner = this.city_data[partnerIndex] // 获取到对应的合伙人信息
money = partner.money
}
let store = []
if (selectStore > -1) {
store = this.scheme.store_type[selectStore]
money = store.money
}
if (money <= 0) return this.$toast({
title: "请选择合伙人身份或开店类型"
});
let params = {
real_name: realName,
province: provinceId,
city: cityId,
district: districtId,
reason,
mobile,
front_id_card,
back_id_card,
hand_id_card,
partner_id: !partner.id ? 0 : partner.id,
store_id: !store.id ? 0 : store.id,
own_city: this.scheme_city.name
};
applyDistribute(params).then((res) => {
if (res.code == 1) {
const id = res.data.id
gh({
money,
partner_id: !partner.id ? 0 : partner.id,
type_id: !store.id ? 0 : store.id
}).then((result) => {
if (result.code == 1) {
const pay = {
nonceStr: result.data.nonceStr,
package: result.data.package,
paySign: result.data.paySign,
signType: result.data.signType,
timeStamp: result.data.timeStamp,
}
const alog_id = result.data.alog_id
this.handleWechatPay(pay, alog_id, id);
}
})
}
})
},
// 微信支付
handleWechatPay(data, alog_id, id) {
wxpay(data).then(res => {
console.log('res=', res)
this.handPayResult(res, alog_id, id)
}).catch(err => {
console.log('err=', err)
})
},
// 支付后处理
handPayResult(result, alog_id, id) {
if (result === 'success') {
this.successPopup = true
checkReturn({
alog_id,
id
})
} else if (result === 'fail') {
this.cancelPopup = true
}
setTimeout(() => {
this.$toast({
title: ''
}, {
tab: 1,
url: '/pages/user/user'
});
}, 800)
},
// 填写邀请码
bindSuperiorFun() {
bindSuperior({
invite_code: this.inviteCode
}).then(res => {
this.$toast({
title: res.msg
})
if (res.code == 1) {
this.showPop = false
this.getSuperiorInfoFun();
}
});
},
saveQrcode() {
// #ifndef H5
uni.showLoading({
title: '正在下载……'
});
uni.downloadFile({
url: this.wxImage,
success: (res) => {
if (res.statusCode === 200) {
//隐藏加载框
uni.hideLoading();
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function(res) {
uni.showToast({
icon: 'none',
mask: true,
title: '文件已保存',
duration: 3000
});
},
fail: function() {
console.log('保存失败');
}
});
}
},
fail: function() {
uni.showToast({
icon: 'none',
mask: true,
title: '失败请重新下载'
});
}
})
// #endif
// #ifdef H5
this.$toast({
title: '请长按图片保存'
})
// #endif
},
// 原版本 填写邀请码
// bindSuperiorFun() {
// bindSuperior({
// invite_code: this.inviteCode
// }).then(res => {
// this.$toast({
// title: res.msg
// })
// if (res.code == 1) {
// this.showPop = false
// this.getSuperiorInfoFun();
// }
// });
// },
showInvitePop() {
this.showPop = true;
},
// 获取邀请人信息
async getSuperiorInfoFun() {
const {
data,
code
} = await getSuperiorInfo()
if (code == 1) {
this.userInfo = data
}
},
onCopy() {
if (this.userInfo.procurement.distribution_code) {
copy(this.userInfo.procurement.distribution_code)
}
},
// 小程序分享
onShareAppMessage() {
return {
title: '分销推广',
imageUrl: 'https://zjeloong.oss-cn-hangzhou.aliyuncs.com/uploads/wx_mini_program/202407171721205600.jpg?v=' +
new Date().getTime(),
path: '/pages/index/index?invite_code=' + this.userInfo.procurement.distribution_code
}
},
openStore(i) {
this.selectStore = i
},
selectPartner(i) {
this.partnerIndex = i
if (this.city_data[i].type > 1) {
this.selectStore = -1
}
}
},
computed: {
...mapGetters(['appConfig']),
},
watch: {
scheme_city: {
handler(val) {
if (val && val.name && this.scheme && this.scheme.partner.length > 0) {
const city = val.name
const partner = this.scheme.partner
let arr = []
partner.map((v, k) => {
arr[k] = {
id: v.id,
city: v.city,
partner: v.partner, // 对应的类型
money: v.city.includes(city) ? v.core_city_money : v.un_core_city_money,
isCore: v.city.includes(city) ? true : false,
proportion: v.proportion, // 比例
type: v.type,
}
})
this.city_data = arr
}
},
deep: true
}
}
};
</script>
<style lang="scss">
.user-spread {
background-image: url(../../static/spread_top_bg.png);
background-repeat: no-repeat;
background-size: 100% auto;
.header {
.user-info {
.user-avatar {
position: relative;
}
.avatar-tag {
display: inline-block;
background-color: #F79C0C;
border: 1rpx solid #FFFFFF;
border-radius: 100rpx;
line-height: 32rpx;
padding: 0 10rpx;
}
.user-message {
.write-btn {
height: 42rpx;
width: 100rpx;
background-color: #FF838D;
}
}
}
}
.main {
padding: 0 20rpx;
.user-vip {
.user-assets-box {
background-color: #fff;
border-radius: 20rpx;
padding: 10rpx 20rpx 22rpx;
background: linear-gradient(90deg, #FBEFDB 0%, #FED09E 100%);
.user-assets-header {
border-bottom: 1rpx dashed #8F430E;
padding-bottom: 4rpx;
.primary-btn {
height: 54rpx;
border-radius: 120rpx;
width: 144rpx;
background: linear-gradient(180deg, #FF3067 0%, #FF2C3C 100%);
}
}
.user-assets-content {
margin-top: 30rpx;
.user-item {
flex: 1;
position: relative;
.user-assets-name {
text-align: left;
align-self: flex-start;
}
.assets {
margin-top: 14rpx;
text-align: left;
align-self: flex-start;
}
}
}
}
.fans-msg-box {
border-radius: 10rpx;
line-height: 42rpx;
.my-fans {
height: 120rpx;
}
.line {
width: 3rpx;
height: 60rpx;
background-color: #E5E5E5;
}
.invite-fans {
height: 120rpx;
}
}
.my-invite-box {
padding: 26rpx 0 57rpx;
border-radius: 10rpx;
.invite-copy-btn {
line-height: 30rpx;
padding: 10rpx;
background: linear-gradient(90deg, #FEE4B4 0%, #FBCB96 100%);
color: #8F430E;
border-radius: 4rpx;
}
.my-promote-banner {
margin-top: 30rpx;
height: 148rpx;
width: 542rpx;
border-radius: 10rpx;
}
}
.usual-tools-box {
border-radius: 10rpx;
padding: 0 25rpx;
.usual-tools-header {
height: 100rpx;
line-height: 44rpx;
border-bottom: $-solid-border;
}
.usual-content {
padding: 40rpx 0;
.usual-item {
width: 25%;
.usual-item-img {
width: 56rpx;
height: 56rpx;
flex: none;
}
}
}
}
}
.user-apply-box {
.user-apply-vip {
background-color: white;
padding: 40rpx 0 0rpx;
border-radius: 20rpx;
.title {
line-height: 30rpx;
font-weight: bold;
}
.explain {
margin-top: 20rpx;
image {
width: 24rpx;
height: 24rpx;
flex: none;
}
span {
font-size: 20rpx;
line-height: 30rpx;
}
}
.vip-form {
width: 100%;
margin-top: 60rpx;
.form-item {
border: $-solid-border;
margin: 0 30rpx 30rpx;
border-radius: 10rpx;
.apply-form-upload {
width: 120rpx;
height: 120rpx;
text-align: center;
margin-left: 12rpx;
image {
width: 120rpx;
height: 120rpx;
margin-left: 20rpx;
}
}
}
}
}
.apply-btn {
line-height: 30rpx;
height: 82rpx;
}
}
.user-result-box {
.user-result {
background-color: white;
padding: 36rpx 14rpx 50rpx;
border-radius: 20rpx;
.user-result-header {
.title {
line-height: 30rpx;
font-weight: bold;
}
}
.user-result-content {
padding: 60rpx 0 22rpx;
width: 100%;
border-bottom: $-solid-border;
.apply-result-img {
width: 100rpx;
height: 100rpx;
}
}
.user-result-info {
margin-top: 42rpx;
width: 100%;
.info-item {
margin-left: 60rpx;
margin-bottom: 28rpx;
line-height: 30rpx;
.label {
width: 140rpx;
}
}
}
}
.apply-btn {
line-height: 30rpx;
height: 82rpx;
}
.bg-gray {
background-color: #CCCCCC;
}
}
}
}
.main .user-apply-box .apply-btn {
line-height: 30rpx;
height: 82rpx;
}
.main .user-result-box .user-result-content .apply-fail-reason {
color: $-color-primary;
line-height: 36rpx;
margin-top: 10rpx;
}
/* 弹窗 */
.inviteform-contain {
padding-left: 30rpx;
padding-right: 30rpx;
padding-bottom: 30rpx;
width: 580rpx;
border-radius: 6rpx;
background-color: $-color-white;
}
.inviteform-contain .title {
padding: 26rpx 0rpx;
}
.inviteform-contain .modify-row {
padding: 32rpx 0px;
width: 100%;
border-bottom: 1rpx solid #E5E5E5;
}
.inviteform-contain .btn {
height: 80rpx;
padding: 0 180rpx;
border-radius: 10rpx;
margin-top: 60rpx;
}
.wxImage {
width: 320rpx;
height: 320rpx;
margin-top: 40rpx;
}
.open-shop {
padding: 20rpx 28rpx;
.open-category {
display: grid;
grid-template-columns: repeat(2, 48%);
grid-row-gap: 24rpx;
justify-content: space-between;
.open-item {
border: 1px solid #ccc;
padding: 20rpx;
border-radius: 10rpx;
text-align: center;
}
.active {
border-color: #FF2C3C;
color: #FF2C3C;
}
}
}
.pay-popup {
.content {
padding: 40rpx 0;
text-align: center;
width: 560rpx;
border-radius: 20rpx;
}
.img-icon {
width: 112rpx;
height: 112rpx;
display: inline-block;
}
.btn {
margin: 80rpx 60rpx 0;
}
}
</style>