第一次提交
This commit is contained in:
275
package/salesman/profit/index.vue
Normal file
275
package/salesman/profit/index.vue
Normal file
@@ -0,0 +1,275 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<mescroll-body ref="mescrollRef" :sticky="true" @init="mescrollInit" :down="{ use: false }" :up="upOption"
|
||||
@up="upCallback">
|
||||
|
||||
<!-- tab栏 -->
|
||||
<u-tabs :list="tabList" :is-scroll="false" :current="curTab" active-color="#0f80ff" :duration="0.2"
|
||||
@change="onChangeTab" />
|
||||
|
||||
<!-- 列表数据 -->
|
||||
<view class="widget-list">
|
||||
<view class="widget__detail dis-flex flex-x-between" v-for="(item, index) in list.data" :key="index">
|
||||
<view class="detail__left dis-flex flex-dir-column flex-x-around">
|
||||
<view class="detail__time col-9 f-24 order-no">订单号:2022092457995352</view>
|
||||
<view class="detail__money f-30">
|
||||
<u-avatar size="mini" mode="circle" v-if="item.sendUser" :src="item.sendUser.avatar_url">
|
||||
</u-avatar>
|
||||
<view class="content">
|
||||
<text>{{ item.sendUser.nick_name }}</text>
|
||||
<text class="detail__time col-9 f-24">消费金额:¥268.00</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail__right dis-flex flex-dir-column flex-x-center flex-y-center">
|
||||
<view class="detail__status f-28">
|
||||
<text>已完成</text>
|
||||
<view>+ 56.00</view>
|
||||
<!-- <u-tag v-if="item.status == 0" type="error" text="未结算"></u-tag>
|
||||
<u-tag v-if="item.status == 1" type="success" text="已结算"></u-tag> -->
|
||||
</view>
|
||||
<view class="detail__time col-9 f-24">{{ item.create_time }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</mescroll-body>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MescrollBody from '@/components/mescroll-uni/mescroll-body.vue'
|
||||
import MescrollMixin from '@/components/mescroll-uni/mescroll-mixins'
|
||||
import {
|
||||
getEmptyPaginateObj,
|
||||
getMoreListData
|
||||
} from '@/core/app'
|
||||
import * as Api from '@/api/user/notice.js'
|
||||
import SettingModel from '@/common/model/dealer/Setting'
|
||||
import {
|
||||
ApplyStatusEnum
|
||||
} from '@/common/enum/dealer/withdraw'
|
||||
|
||||
const pageSize = 15
|
||||
// 提现状态文字
|
||||
const ApplyStatusText = [0, 1]
|
||||
|
||||
export default {
|
||||
components: {
|
||||
MescrollBody
|
||||
},
|
||||
mixins: [MescrollMixin],
|
||||
data() {
|
||||
return {
|
||||
// 枚举类
|
||||
ApplyStatusEnum,
|
||||
ApplyStatusText,
|
||||
// 选项卡列表
|
||||
tabList: [],
|
||||
// 当前选项
|
||||
curTab: 0,
|
||||
// 列表数据
|
||||
list: getEmptyPaginateObj(),
|
||||
shopId: 0,
|
||||
showReasonMsg: false,
|
||||
// 上拉加载配置
|
||||
upOption: {
|
||||
// 首次自动执行
|
||||
auto: true,
|
||||
// 每页数据的数量; 默认10
|
||||
page: {
|
||||
size: pageSize
|
||||
},
|
||||
// 数量要大于12条才显示无更多数据
|
||||
noMoreSize: 12,
|
||||
// 空布局
|
||||
empty: {
|
||||
tip: '亲,暂无收益数据'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.getSetting()
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
// 获取分销设置
|
||||
getSetting() {
|
||||
const app = this
|
||||
SettingModel.data()
|
||||
.then(setting => {
|
||||
const words = setting.words.withdraw_list
|
||||
app.setTabList(words.words)
|
||||
})
|
||||
},
|
||||
|
||||
// 设置选项卡数据
|
||||
setTabList(words) {
|
||||
const app = this
|
||||
app.tabList = [
|
||||
{
|
||||
value: 0,
|
||||
name: '全部'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
triggerReasonMsg() {
|
||||
this.showReasonMsg = !this.showReasonMsg
|
||||
},
|
||||
|
||||
/**
|
||||
* 上拉加载的回调 (页面初始化时也会执行一次)
|
||||
* 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10
|
||||
* @param {Object} page
|
||||
*/
|
||||
upCallback(page) {
|
||||
const app = this
|
||||
// 设置列表数据
|
||||
app.getList(page.num)
|
||||
.then(list => {
|
||||
const curPageLen = list.data.length
|
||||
const totalSize = list.data.total
|
||||
app.mescroll.endBySize(curPageLen, totalSize)
|
||||
})
|
||||
.catch(() => app.mescroll.endErr())
|
||||
},
|
||||
|
||||
// 获取提现列表
|
||||
getList(pageNo = 1) {
|
||||
const app = this
|
||||
return new Promise((resolve, reject) => {
|
||||
Api.list({
|
||||
page: pageNo
|
||||
})
|
||||
.then(result => {
|
||||
// 合并新数据
|
||||
const newList = result.data.list
|
||||
app.list.data = getMoreListData(newList, app.list, pageNo)
|
||||
resolve(newList)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 获取当前标签项的值
|
||||
getTabValue() {
|
||||
const app = this
|
||||
if (app.tabList.length) {
|
||||
return app.tabList[app.curTab].value
|
||||
}
|
||||
return 1
|
||||
},
|
||||
|
||||
// 切换标签项
|
||||
onChangeTab(index) {
|
||||
const app = this
|
||||
// 设置当前选中的标签
|
||||
app.curTab = index
|
||||
// 刷新订单列表
|
||||
app.onRefreshList()
|
||||
},
|
||||
|
||||
// 刷新列表数据
|
||||
onRefreshList() {
|
||||
this.list = getEmptyPaginateObj()
|
||||
setTimeout(() => {
|
||||
this.mescroll.resetUpScroll()
|
||||
}, 120)
|
||||
},
|
||||
|
||||
// 设为已读
|
||||
onRead(id, content) {
|
||||
const app = this
|
||||
uni.showModal({
|
||||
title: '查看消息',
|
||||
content,
|
||||
showCancel: false,
|
||||
success({ confirm }) {
|
||||
Api.status({id}).then(res => {
|
||||
app.getList()
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
// 提现明细列表
|
||||
.widget-list {
|
||||
padding: 10rpx 20rpx 40rpx 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.widget__detail {
|
||||
padding: 20rpx 15rpx;
|
||||
box-sizing: border-box;
|
||||
font-size: 28rpx;
|
||||
border-bottom: 1rpx solid #e7e7e7;
|
||||
}
|
||||
|
||||
.widget__detail .detail__money {
|
||||
font-size: 30rpx;
|
||||
margin-bottom: 12rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.widget__detail .detail__reason {
|
||||
margin-top: 15rpx;
|
||||
color: #0f80ff;
|
||||
}
|
||||
|
||||
.show-reason-msg {
|
||||
padding: 20rpx;
|
||||
line-height: 2rem;
|
||||
color: #ff0000;
|
||||
}
|
||||
|
||||
.detail__left {
|
||||
.iconfont {
|
||||
margin-left: 30rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.icon-weixin {
|
||||
color: #0eaf00;
|
||||
}
|
||||
|
||||
.icon-alipay {
|
||||
color: #0f80ff;
|
||||
}
|
||||
}
|
||||
|
||||
.detail__status {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.detail__money {
|
||||
.content {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
}
|
||||
.modal-content{
|
||||
padding: 20rpx;
|
||||
}
|
||||
.order-no{
|
||||
line-height: 2rem;
|
||||
}
|
||||
</style>
|
||||
84
package/salesman/qrcode/index.vue
Normal file
84
package/salesman/qrcode/index.vue
Normal file
@@ -0,0 +1,84 @@
|
||||
<template>
|
||||
<view class="partner">
|
||||
<!-- 表单组件 -->
|
||||
<view class="form-wrapper">
|
||||
<view class="item-list">
|
||||
<image :src="shopPosterUrl" mode="widthFix"></image>
|
||||
<text>推广商户二维码</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-wrapper">
|
||||
<view class="item-list">
|
||||
<image :src="userPosterUrl" mode="widthFix"></image>
|
||||
<text>推广用户二维码</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as Api from '@/api/dealer/poster'
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
shopPosterUrl: undefined,
|
||||
userPosterUrl: undefined
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getPoster()
|
||||
},
|
||||
methods: {
|
||||
// 获取推广二维码
|
||||
getPoster() {
|
||||
const app = this
|
||||
app.isLoading = true
|
||||
Api.qrcode({ channel: app.platform })
|
||||
.then(result => {
|
||||
// api数据赋值
|
||||
app.shopPosterUrl = result.data.shopPosterUrl
|
||||
app.userPosterUrl = result.data.userPosterUrl
|
||||
})
|
||||
.finally(() => app.isLoading = false)
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.partner {
|
||||
|
||||
.banner {
|
||||
width: 100%;
|
||||
}
|
||||
.form-wrapper {
|
||||
margin: 30rpx auto 50rpx auto;
|
||||
padding: 30rpx 40rpx;
|
||||
width: 94%;
|
||||
box-shadow: 0 1rpx 5rpx 0px rgba(0, 0, 0, 0.05);
|
||||
border-radius: 16rpx;
|
||||
background: #fff;
|
||||
.item-list{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
image{
|
||||
width: 70%;
|
||||
margin: auto;
|
||||
}
|
||||
text{
|
||||
line-height: 2rem;
|
||||
font-size: 34rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
.footer{
|
||||
width: 500rpx;
|
||||
margin: 20rpx auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
303
package/salesman/storehouse/index.vue
Normal file
303
package/salesman/storehouse/index.vue
Normal file
@@ -0,0 +1,303 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 展馆图标 -->
|
||||
<!-- <view class="header-box">
|
||||
<view class="location" @click="changeCity">
|
||||
<image src="../../static/postion.svg"></image><text>南宁</text>
|
||||
</view>
|
||||
<view class="search-wrapper">
|
||||
<view class="search-input">
|
||||
<view class="search-input-wrapper">
|
||||
<view class="left">
|
||||
<text class="search-icon iconfont icon-search"></text>
|
||||
</view>
|
||||
<view class="right">
|
||||
<input v-model="searchValue" class="input" focus="true" placeholder="请输入您搜索的商品"
|
||||
type="text"></input>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-button">
|
||||
<button class="button" @click="onSearch" type="warn">搜索</button>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 门店列表 -->
|
||||
<view class="shop-list">
|
||||
<u-card v-for="(item, index) in shopList" :key="index" @click="onSelectedShop(item)"
|
||||
class="shop-item dis-flex flex-y-center" :border="false" :box-shadow="true" :show-head="false"
|
||||
:head-border-bottom="false">
|
||||
<view class="" slot="body">
|
||||
<view class="shop-item__content flex-box">
|
||||
<view class="u-body-item u-flex u-col-between u-p-t-0">
|
||||
<u-avatar :src="item.logoUrl" :size="120" mode="square" :show-level="true" ></u-avatar>
|
||||
<view class="shop-info">
|
||||
<view class="title">{{item.shopName}}</view>
|
||||
<view class="address">站点地址:{{ item.region.province }}{{ item.region.city }}{{ item.region.region }}{{ item.address }}</view>
|
||||
<view class="address">获得收益:<text class="first-commission-money">¥{{ item.firstCommissionMoney }}</text></view>
|
||||
<!-- <view v-if="item.distance" class="shop-item__distance">
|
||||
<text class="iconfont icon-dingwei"></text>
|
||||
<text class="f-24">{{ item.distance_unit }}</text>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 选中状态 -->
|
||||
<!-- <view v-if="item.shop_id == selectedId" class="shop-item__right">
|
||||
<text class="iconfont icon-check1"></text>
|
||||
</view> -->
|
||||
</view>
|
||||
</u-card>
|
||||
</view>
|
||||
<!-- 定位按钮 -->
|
||||
<view v-if="!isAuthor" class="widget-location dis-flex flex-x-center flex-y-center" @click="onAuthorize()">
|
||||
<text class="iconfont icon-locate"></text>
|
||||
</view>
|
||||
<empty v-if="!shopList.length" :isLoading="isLoading" tips="亲,暂无自提门店哦" />
|
||||
|
||||
<!-- <view class="shop-list">
|
||||
<u-card v-for="(item,index) in list" :key="index" :border="false" :box-shadow="true" :show-head="false"
|
||||
:head-border-bottom="false">
|
||||
<view class="" slot="body">
|
||||
<view class="u-body-item u-flex u-col-between u-p-t-0">
|
||||
<image class="shop-avatar"
|
||||
:src="item.logo_url"
|
||||
mode="widthFix"></image>
|
||||
<view class="shop-info">
|
||||
<view class="title">{{item.shop_name}}</view>
|
||||
<view class="about">{{item.summary}}</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</u-card>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Search from '@/components/page/diyComponents/search/index.vue'
|
||||
import {
|
||||
getMoreListData
|
||||
} from '@/core/app'
|
||||
import * as ShopApi from '@/api/shop.js'
|
||||
import Empty from '@/components/empty'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Search,
|
||||
Empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '国内馆',
|
||||
// 正在加载中
|
||||
isLoading: true,
|
||||
// 是否授权了定位权限
|
||||
isAuthor: true,
|
||||
// 当前选择的门店ID
|
||||
selectedId: null,
|
||||
// 订单列表数据
|
||||
shopList: [],
|
||||
|
||||
}
|
||||
},
|
||||
onLoad({
|
||||
selectedId
|
||||
}) {
|
||||
const app = this
|
||||
// 记录当前选择的门店ID
|
||||
app.selectedId = selectedId ? selectedId : null
|
||||
// 获取默认门店列表
|
||||
app.getShopList()
|
||||
// 获取用户坐标
|
||||
app.getLocation(res => {
|
||||
app.getShopList(res.longitude, res.latitude)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 获取门店列表
|
||||
getShopList(longitude, latitude) {
|
||||
const app = this
|
||||
app.isLoading = true
|
||||
ShopApi.list({
|
||||
isCheck: 1,
|
||||
longitude,
|
||||
latitude,
|
||||
dealerReferee: true
|
||||
})
|
||||
.then(result => app.shopList = result.data.list)
|
||||
.finally(() => app.isLoading = false)
|
||||
},
|
||||
|
||||
// 获取用户坐标
|
||||
// 参考文档:https://uniapp.dcloud.io/api/location/location?id=getlocation
|
||||
getLocation(callback) {
|
||||
const app = this
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
success: callback,
|
||||
fail() {
|
||||
app.$toast('获取定位失败,请点击右下角按钮重新尝试定位')
|
||||
app.isAuthor = false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 授权启用定位权限
|
||||
onAuthorize() {
|
||||
const app = this
|
||||
// #ifdef MP
|
||||
uni.openSetting({
|
||||
success(res) {
|
||||
if (res.authSetting['scope.userLocation']) {
|
||||
console.log('定位权限授权成功')
|
||||
app.isAuthor = true
|
||||
setTimeout(() => {
|
||||
// 获取用户坐标
|
||||
app.getLocation((res) => {
|
||||
app.getShopList(res.longitude, res.latitude)
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
// 获取用户坐标
|
||||
app.getLocation((res) => {
|
||||
app.getShopList(res.longitude, res.latitude)
|
||||
})
|
||||
// #endif
|
||||
},
|
||||
|
||||
/**
|
||||
* 选择门店
|
||||
*/
|
||||
onSelectedShop(item) {
|
||||
this.$navTo('package/shops/detail/index',item)
|
||||
},
|
||||
|
||||
changeCity() {
|
||||
this.$toast('切换区域')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.bg {
|
||||
background-color: #F5F5F8
|
||||
}
|
||||
|
||||
.shop-list {
|
||||
.shop-item {
|
||||
}
|
||||
}
|
||||
|
||||
.header-box {
|
||||
padding: 20rpx 36rpx 0 36rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.location {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
image {
|
||||
width: 60rpx;
|
||||
height: 60rpx
|
||||
}
|
||||
}
|
||||
|
||||
.u-subsection {
|
||||
width: 260rpx;
|
||||
margin-top: 7rpx
|
||||
}
|
||||
}
|
||||
|
||||
.search-wrapper {
|
||||
display: flex;
|
||||
width: 80%;
|
||||
height: 64rpx
|
||||
}
|
||||
|
||||
// 搜索输入框
|
||||
.search-input {
|
||||
width: 90%;
|
||||
background: #fff;
|
||||
border-radius: 10rpx 0 0 10rpx;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
|
||||
.search-input-wrapper {
|
||||
display: flex;
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
width: 60rpx;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.search-icon {
|
||||
display: block;
|
||||
color: #b4b4b4;
|
||||
font-size: 28rpx
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
flex: 1;
|
||||
|
||||
input {
|
||||
font-size: 28rpx;
|
||||
height: 64rpx;
|
||||
display: flex;
|
||||
|
||||
.input-placeholder {
|
||||
color: #aba9a9
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.shop-avatar {
|
||||
width: 200rpx;
|
||||
margin-right: 24rpx
|
||||
}
|
||||
|
||||
// 搜索按钮
|
||||
.search-button {
|
||||
width: 25%;
|
||||
box-sizing: border-box;
|
||||
|
||||
.button {
|
||||
height: 64rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 0 5px 5px 0;
|
||||
background: #2C71C7
|
||||
}
|
||||
}
|
||||
|
||||
.shop-info {
|
||||
width: 100%;
|
||||
margin-left: 20rpx;
|
||||
|
||||
.title {
|
||||
font-size: 38rpx;
|
||||
font-weight: bold;
|
||||
padding-bottom: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.u-body-item {
|
||||
align-items: stretch !important
|
||||
}
|
||||
.first-commission-money{
|
||||
color: #ff0000;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user