This commit is contained in:
DESKTOP-GMUNQ1B\k 2024-04-02 14:46:49 +08:00
parent 5bf33c61c0
commit 4e9e9862db
12 changed files with 1071 additions and 924 deletions

94
App.vue
View File

@ -16,13 +16,11 @@
checkLogin
} from "./libs/login";
import {
getUserInfo
} from '@/api/user.js';
import {
parseToken
} from "@/api/appLet.js";
import {
parseToken
} from "@/api/appLet.js";
import {
HTTP_REQUEST_URL
} from './config/app';
@ -32,7 +30,9 @@
history
} from '@/api/public.js'
import Routine from './libs/routine.js';
import { Toast } from "./libs/uniApi";
import {
Toast
} from "./libs/uniApi";
export default {
data() {
@ -97,47 +97,47 @@
key: 'launchFlag'
})
//
// parseToken({
// token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjZXNoaS1taWRkbGUubGloYWluay5jbiIsImF1ZCI6ImNlc2hpLW1pZGRsZS5saWhhaW5rLmNuIiwiaWF0IjoxNzAwNjIwMjUxLCJuYmYiOjE3MDA2MjAyNTEsImV4cCI6MTcwMTIyNTA1MSwiZGF0YSI6eyJ1aWQiOjUsInBob25lIjoiMTc2ODUxNTE2NDMiLCJhdmF0YXIiOiIvcmVzb3VyY2UvaW1hZ2UvYWRtaW5hcGkvZGVmYXVsdC9kZWZhdWx0X2F2YXRhci5wbmciLCJuaWNrbmFtZSI6Ilx1NzUyOFx1NjIzNzE3Njg1MTUxNjQzIn19.sTWAHCScRY9FExwJw1MReHTnRBcK7tYu1AMSia_Sm4M'
// }).then((res)=>{
// this.$store.commit("LOGIN", {
// 'token': res.data.token,
// 'time': 604800
// });
// this.$isResolve()
// }).catch((err)=>{
// if(err==''){
// this.$store.commit("LOGIN", {
// 'token': option.referrerInfo?.extraData?.uniMP,
// 'time': 604800
// });
// }else {
// Toast(err);
// }
// this.$isResolve()
// })
//
// parseToken({
// token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjZXNoaS1taWRkbGUubGloYWluay5jbiIsImF1ZCI6ImNlc2hpLW1pZGRsZS5saWhhaW5rLmNuIiwiaWF0IjoxNzAwNjIwMjUxLCJuYmYiOjE3MDA2MjAyNTEsImV4cCI6MTcwMTIyNTA1MSwiZGF0YSI6eyJ1aWQiOjUsInBob25lIjoiMTc2ODUxNTE2NDMiLCJhdmF0YXIiOiIvcmVzb3VyY2UvaW1hZ2UvYWRtaW5hcGkvZGVmYXVsdC9kZWZhdWx0X2F2YXRhci5wbmciLCJuaWNrbmFtZSI6Ilx1NzUyOFx1NjIzNzE3Njg1MTUxNjQzIn19.sTWAHCScRY9FExwJw1MReHTnRBcK7tYu1AMSia_Sm4M'
// }).then((res)=>{
// this.$store.commit("LOGIN", {
// 'token': res.data.token,
// 'time': 604800
// });
// this.$isResolve()
// }).catch((err)=>{
// if(err==''){
// this.$store.commit("LOGIN", {
// 'token': option.referrerInfo?.extraData?.uniMP,
// 'time': 604800
// });
// }else {
// Toast(err);
// }
// this.$isResolve()
// })
if (option?.referrerInfo?.extraData?.uniMP) {
uni.setStorageSync('uniMP', option.referrerInfo?.extraData?.uniMP);
parseToken({
token: option.referrerInfo?.extraData?.token
}).then((res)=>{
this.$store.commit("LOGIN", {
'token': res.data.token,
'time': 604800
});
this.$isResolve()
}).catch((err)=>{
this.$store.commit("LOGIN", {
'token': option.referrerInfo?.extraData?.token,
'time': 604800
});
this.$isResolve()
})
}else {
this.$isResolve()
}
parseToken({
token: option.referrerInfo?.extraData?.token
}).then((res) => {
this.$store.commit("LOGIN", {
'token': res.data.token,
'time': 604800
});
this.$isResolve()
}).catch((err) => {
this.$store.commit("LOGIN", {
'token': option.referrerInfo?.extraData?.token,
'time': 604800
});
this.$isResolve()
})
} else {
this.$isResolve()
}
// #ifdef APP-PLUS
// #endif
@ -431,6 +431,12 @@
box-sizing: border-box;
}
.c_active {
&:active {
opacity: .8;
}
}
.custom_style {
color: #fff;
display: flex;

View File

@ -1,5 +1,16 @@
import request from "@/utils/request.js";
/**
* 获取商铺云商品列表
* @param {Object} id 商铺 id
* @param {Object} data 商铺商品列表数据
*/
export function getStoreCloudGoods(id, data) {
return request.get("product/spu/merchant/" + id + "/merCloudProduct", data, {
noAuth: true
});
}
/**
* 扫码查询商品
*
@ -595,8 +606,7 @@ export function vicinityStoreApi(data) {
商家入驻 -- 获取商户入驻申请协议内容
*/
export function agreeiness(data) {
return request.get(`business/agree`, data, { noAuth: true });
}
return request.get(`business/agree`, data, {
noAuth: true
});
}

View File

@ -12,6 +12,14 @@ import request1 from "@/utils/requestb.js";
import Cache from '@/utils/cache'
/**
* 报错信息记录
*/
export function errorReport(data) {
return request.post(`api/err/report`, data);
}
/**
* 提现----查询单条信息
*/

View File

@ -78,6 +78,12 @@
"scrollIndicator": false //
}
}
}, {
"path": "pages/index/unregist",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/nongKe/supply_chain/shopping_trolley",

View File

@ -901,7 +901,20 @@
handleToWithDraw(item, index) {
if (index == 4) return;
let url;
if (index == 0) url = "/pages/users/embody/embody?mer_id=" + this.userInfoData.service.mer_id;
if (index == 0) {
progressBankList(this.userInfoData.service.mer_id).then(res => {
const data = res.data.list || [];
if ((data.length == 1 && data[0].is_check === 0) || (data.length == 2 && data[
0].is_check === 0 && data[1].is_check === 0)) {
url = '/pages/withdrawal/progress?mer_id=' + this.userInfoData.service.mer_id
} else {
url = '/pages/withdrawal/index?mer_id=' + this.userInfoData.service.mer_id
}
return uni.navigateTo({
url: url
})
})
}
if (index == 2) url = `/pages/admin/orderList/index?merId=${this.userInfoData.service.mer_id}&types=`;
if (index == 3) url = "/pages/activeCode/subsidy";
@ -1333,17 +1346,21 @@
this.isgShow = true
}
if (res.data.mer_info.length == 0) {
uni.showModal({
title: '暂未开通商户',
complete(res) {
// #ifdef APP-PLUS
uni.sendHostEvent('closeApp', (ret) => {
//
console.log('关闭应用' + JSON.stringify(ret));
});
// #endif
}
//
uni.reLaunch({
url: "/pages/index/unregist"
})
// uni.showModal({
// title: '',
// complete(res) {
// // #ifdef APP-PLUS
// uni.sendHostEvent('closeApp', (ret) => {
// //
// console.log('' + JSON.stringify(ret));
// });
// // #endif
// }
// })
} else {
this.getindex()
this.getGoods(true)
@ -1482,9 +1499,6 @@
//
progressBankList(this.userInfoData.service.mer_id).then(res => {
const data = res.data.list || [];
console.log(data.length == 1 && data[0].is_check === 0)
if ((data.length == 1 && data[0].is_check === 0) || (data.length == 2 && data[
0].is_check === 0 && data[1].is_check === 0)) {
uni.navigateTo({

106
pages/index/unregist.vue Normal file
View File

@ -0,0 +1,106 @@
<!-- 未开通商户 -->
<template>
<view class="unregist">
<view class="head">
<image src="@/static/images/f.png"></image>
<text>暂无信息</text>
</view>
<view class="con">
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e70e7202404021040448288.png"></image>
<text class="empty">暂无数据</text>
<text class="no_shop">您还没有开通商户</text>
</view>
<view class="btn c_active" @click="handleOpen">
<text>点击开通</text>
</view>
</view>
</template>
<script>
export default {
methods: {
handleOpen() {
// #ifdef APP-PLUS
uni.sendHostEvent('closeAppToOpenShop', (ret) => {
//
console.log('关闭应用' + JSON.stringify(ret));
});
// #endif
}
}
}
</script>
<style lang="scss">
.unregist {
.head {
display: flex;
align-items: center;
width: 100%;
height: 360rpx;
background-image: url(https://lihai001.oss-cn-chengdu.aliyuncs.com/def/a2e04202404021019436262.webp);
background-size: cover;
background-repeat: no-repeat;
background-position: center;
margin-bottom: 200rpx;
image {
width: 112rpx;
height: 112rpx;
border-radius: 50%;
margin: 0 12rpx 0 60rpx;
}
text {
font-size: 28rpx;
color: #FFFFFF;
}
}
.con {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
image {
width: 512rpx;
height: 334rpx;
margin: 0 auto;
}
.empty {
margin-bottom: 16rpx;
font-size: 34rpx;
color: #000000;
}
.no_shop {
font-size: 24rpx;
color: #999999;
line-height: 0rpx;
}
}
.btn {
position: fixed;
left: 50%;
transform: translateX(-50%);
bottom: 80rpx;
width: 650rpx;
height: 88rpx;
line-height: 88rpx;
background: linear-gradient(359deg, #72BE53 0%, #46B03A 100%);
border-radius: 88rpx;
text-align: center;
text {
font-weight: 600;
font-size: 30rpx;
color: #F5F5F5;
}
}
}
</style>

View File

@ -18,18 +18,26 @@
<view class="shop-type-con">
<view class="shop-type-con-title">点击选择变更的商户类型</view>
<view class="pifa" @click="handleChoose(1)">
<view class="pifa-title">
<view class="main-title">升级为批发商户</view>
<view class="sub-title">备注:批发商户仅能销售批发价产品产品仅展示在批发-供销云市场批发类目</view>
</view>
<image v-if="selected == '' || selected == 2"
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/b0811202403191613185951.webp" mode="">
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/d8a38202404011735139115.webp" mode="">
</image>
<image v-if="selected == 1"
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/d7d97202403191611433157.webp" mode=""></image>
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/145e2202404011734207958.webp" mode=""></image>
</view>
<view class="pifalingshou" @click="handleChoose(2)">
<view class="pifa-title">
<view class="main-title">升级为批发/零售商户</view>
<view class="sub-title">备注:批发/零售商户可以进行批发与零售交易产品可在供销云市场全面展示</view>
</view>
<image v-if="selected == '' || selected == 1"
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/39776202403191612456811.webp" mode="">
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/a9447202404011734582066.webp" mode="">
</image>
<image v-if="selected == 2"
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/40592202403191613498205.webp" mode=""></image>
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/19c0b202404011735289980.webp" mode=""></image>
</view>
</view>
@ -52,12 +60,10 @@
},
onLoad(opt) {
if (opt.mer_id)
this.mer_id = opt.mer_id;
if (opt.mer_id) this.mer_id = opt.mer_id;
},
methods: {
handleToRecord() {
uni.navigateTo({
url: "/pages/product/shop_type_change/list?mer_id=" + this.mer_id,
@ -173,20 +179,43 @@
display: flex;
justify-content: center;
margin-bottom: 30rpx;
position: relative;
image {
width: 690rpx;
height: 178rpx;
height: 200rpx;
}
}
.pifalingshou {
position: relative;
display: flex;
justify-content: center;
image {
width: 690rpx;
height: 178rpx;
height: 200rpx;
}
}
.pifa-title {
position: absolute;
z-index: 10;
padding-top: 36rpx;
margin-left: 202rpx;
width: 464rpx;
.main-title {
margin-bottom: 14rpx;
font-weight: 600;
font-size: 30rpx;
color: #333333;
}
.sub-title {
font-size: 24rpx;
color: #555555;
line-height: 45rpx;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -335,47 +335,46 @@
let that = this;
loginMpPhone({
iv: e.detail.iv,
encryptedData: e.detail.encryptedData,
code: that.codeVal,
auth_token: uni.getStorageSync('auth_token'),
}).then(({
data
}) => {
const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
that.$Cache.clear(BACK_URL);
that.$store.commit("LOGIN", {
'token': data.token,
'time': data.exp
});
that.$store.commit("SETUID", data.user.uid);
that.$store.commit('UPDATE_USERINFO', data.user);
let method
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart',
'/pages/goods_cate/goods_cate',
'/pages/user/index', '/pages/plant_grass/index'
]
if (indexPat.includes(this.getPath(backUrl))) {
method = 'switchTab'
} else {
method = 'navigateTo'
}
if (this.getPath(backUrl) === '/pages/users/login/index') {
uni.switchTab({
url: '/pages/index/index'
});
return
}
uni[method]({
url: backUrl
});
})
.catch(res => {
that.$util.Tips({
title: res
});
iv: e.detail.iv,
encryptedData: e.detail.encryptedData,
code: that.codeVal,
auth_token: uni.getStorageSync('auth_token'),
}).then(({
data
}) => {
const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
that.$Cache.clear(BACK_URL);
that.$store.commit("LOGIN", {
'token': data.token,
'time': data.exp
});
that.$store.commit("SETUID", data.user.uid);
that.$store.commit('UPDATE_USERINFO', data.user);
let method
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart',
'/pages/goods_cate/goods_cate',
'/pages/user/index', '/pages/plant_grass/index'
]
if (indexPat.includes(this.getPath(backUrl))) {
method = 'switchTab'
} else {
method = 'navigateTo'
}
if (this.getPath(backUrl) === '/pages/users/login/index') {
uni.switchTab({
url: '/pages/index/index'
});
return
}
uni[method]({
url: backUrl
});
}).catch(res => {
that.$util.Tips({
title: res
});
});
},
// #endif
goCopyUrl() {
@ -436,12 +435,12 @@
});
},
fail(error) {
that.$utils.error("苹果登录/uni.login", JSON.stringify(error))
uni.showToast({
title: '获取用户信息失败',
icon: 'none',
duration: 2000
})
// console.log(error)
}
})
},
@ -493,6 +492,7 @@
that.auth_token = res.data.result.key;
}
}).catch(res => {
that.$utils.error("微信登录/auth", JSON.stringify(res))
uni.hideLoading();
uni.showToast({
title: res.message || res,
@ -520,6 +520,7 @@
self.wxLoginApi()
},
fail(error) {
self.$utils.error("微信登录/uni.login", JSON.stringify(error))
uni.showToast({
title: '登录失败',
icon: 'none',
@ -583,6 +584,7 @@
uni.hideLoading();
}).catch(res => {
uni.hideLoading();
that.$utils.error("微信登录/auth", JSON.stringify(res))
uni.showToast({
title: res.message || res,
icon: 'none',

View File

@ -44,7 +44,7 @@
<view class="withdrawal-form-item">
<view class="withdrawal-form-item-label">持卡人</view>
<view class="withdrawal-form-item-val">
<input v-model="bindForm.name" type="text" placeholder="请输入持卡人姓名"
<input v-model="bindForm.name" type="text" placeholder="请输入持卡人姓名" :disabled="true"
placeholder-class="placeholderClass">
</view>
</view>
@ -126,7 +126,7 @@
<view class="withdrawal-form-item">
<view class="withdrawal-form-item-label">账户名称</view>
<view class="withdrawal-form-item-val">
<input v-model="bindForm.name" type="text" placeholder="请输入账户名称"
<input v-model="bindForm.name" type="text" placeholder="请输入账户名称" :disabled="true"
placeholder-class="placeholderClass">
</view>
</view>
@ -188,7 +188,8 @@
extractBank,
addBank,
searchBank,
getById
getById,
getUserInfo
} from "@/api/user.js";
export default {
data() {
@ -226,19 +227,33 @@
name: '对公账户'
}];
this.bindForm.is_own = 1;
//
this.bindForm.name = JSON.parse(this.$Cache.get("USER_INFO")).mer_info.company_name;
} else if (opt.hasOwnProperty('isOwn') && opt.isOwn == 1) {
this.list = [{
name: '法人账户'
}];
this.bindForm.is_own = 0;
//
this.bindForm.name = JSON.parse(this.$Cache.get("USER_INFO")).mer_info.mer_name;
} else {
this.bindForm.is_own = 0;
//
this.bindForm.name = JSON.parse(this.$Cache.get("USER_INFO")).mer_info.mer_name;
this.list = [{
name: '对公账户'
}, {
name: '法人账户'
}]
}
// , is_company =0
const isCompany = JSON.parse(this.$Cache.get("USER_INFO")).mer_info.is_company;
if (isCompany != 1) {
this.list = [{
name: '法人账户'
}];
}
}
},
@ -260,8 +275,15 @@
//
handleSelected(e) {
this.show = false;
if (e.name == '法人账户') this.bindForm.is_own = 0;
if (e.name == '对公账户') this.bindForm.is_own = 1;
if (e.name == '法人账户') {
this.bindForm.is_own = 0;
this.bindForm.name = JSON.parse(this.$Cache.get("USER_INFO")).mer_info.mer_name;
}
if (e.name == '对公账户') {
//
this.bindForm.is_own = 1;
this.bindForm.name = JSON.parse(this.$Cache.get("USER_INFO")).mer_info.company_name;
}
},
//

View File

@ -11,14 +11,21 @@
</view>
<view class="withdrawal-con">
<view class="withdrawal">
<view class="withdrawal-left" @click="handleAddAccount">
<view class="withdrawal-left">
<text class="withdrawal-left-to">提现至</text>
<text
class="withdrawal-left-empty">{{!bankInfo?'请绑定账户': bankInfo.is_own === 0 ? '法人账户' : '对公账户'}}</text>
</view>
<view class="withdrawal-right" v-if="bankList.length < 2 " @click="handleToAdd">
<text
class="withdrawal-right-add">{{(bankList.length == 0 || bankList.length ==1)?'添加账户' :''}}</text>
<view class="withdrawal-right" @click.stop="handleToAdd" v-if="isShowAdd()">
<text class="withdrawal-right-add">添加账户</text>
<u-icon name="arrow-right" size="14" color="#40AE36"></u-icon>
</view>
<view class="withdrawal-right"
v-if="!isShowAdd() && userInfo.mer_info.is_company == 1 && bankList.length == 2"
@click="handleAddAccount">
<text class="withdrawal-right-add">切换账户</text>
<u-icon name="arrow-right" size="14" color="#40AE36"></u-icon>
</view>
</view>
@ -34,10 +41,6 @@
<view class="withdrawal-form-item-label">持卡人</view>
<view class="withdrawal-form-item-val">{{bankInfo.financial_account.name}}</view>
</view>
<view class="withdrawal-form-item">
<view class="withdrawal-form-item-label">身份证</view>
<view class="withdrawal-form-item-val">{{bankInfo.financial_account.id_card}}</view>
</view>
<view class="withdrawal-form-item">
<view class="withdrawal-form-item-label">银行账号</view>
<view class="withdrawal-form-item-val">{{bankInfo.financial_account.bank_code}}</view>
@ -126,6 +129,9 @@
</view>
</view>
<!-- 明细按钮 -->
<view class="saomaCode" @click="navigator(`/pages/users/gather_list/index?mer_id=${mer_id}`)">明细</view>
<!-- 提现提示 -->
<u-modal :show="tipShow" title="提示"
content='工作日当日10点前提现当日12点到账, 当日16点前提现当日18点到账, 当日18点后提现次日12点到账, 周末节假日提现, 下一工作日18点前到账'
@ -174,15 +180,27 @@
ot_margin: '', //
extract_money: '', //
lock_money: '', //
userInfo: {}
}
},
onLoad(opt) {
this.mer_id = opt.mer_id;
this.getBankInfo();
//
this.userInfo = JSON.parse(this.$Cache.get("USER_INFO"));
console.log(this.userInfo.mer_info.is_company)
},
methods: {
//
isShowAdd() {
if (this.bankList.length == 0) return true;
if (this.bankList.length == 1 && this.userInfo.mer_info.is_company == 1) return true;
return false;
},
//
handlePreview() {
let that = this;
@ -196,6 +214,10 @@
//
handleToAdd() {
// , is_company =0
const isCompany = JSON.parse(this.$Cache.get("USER_INFO")).mer_info.is_company;
if (isCompany != 1 && this.bankInfo && this.bankInfo.is_own === 0) return;
let strUrl = "?mer_id=" + this.mer_id;
if (this.bankInfo) strUrl += "&isOwn=" + this.bankInfo.is_own
uni.navigateTo({
@ -223,23 +245,9 @@
//
handleAddAccount() {
if (this.bankList.length == 0) return this.$util.Tips({
title: "请先添加一个账户!"
})
if (this.bankList.length < 2) {
let isOwn = this.bankList[0].financial_account.is_own;
if (isOwn === 0) {
return this.$util.Tips({
title: "您还没有添加对公账户!"
})
} else {
return this.$util.Tips({
title: "您还没有添加法人账户!"
})
}
}
});
if (this.type === 0)
this.type = 1;
@ -344,6 +352,13 @@
})
},
//
navigator(url, t) {
uni.navigateTo({
url: url
})
},
handleBack() {
uni.navigateBack()
}
@ -470,6 +485,7 @@
font-size: 30rpx;
color: #333333;
text-align: left;
white-space: nowrap;
}
.withdrawal-form-item-val {
@ -519,4 +535,18 @@
}
}
}
.saomaCode {
z-index: 1;
position: fixed;
bottom: 190rpx;
right: 28.07rpx;
width: 87.72rpx;
height: 87.72rpx;
border-radius: 175.44rpx;
background-image: linear-gradient(359deg, #72BE53 0%, #46B03A 100%);
color: #fff;
text-align: center;
line-height: 87.72rpx;
}
</style>

View File

@ -21,7 +21,20 @@ import {
// #ifdef APP-PLUS
import permision from "./permission.js"
// #endif
import {
errorReport
} from "@/api/user.js";
export default {
errorSave: function(a, b) {
errorReport({
route: a,
msg: b
})
},
// 是否设置密码
checkPassword: async function(e) {
e = e ? e : '';