添加:商户入驻时支持设置管理员

This commit is contained in:
wuhui_zzw 2024-01-19 17:09:53 +08:00
parent 2ba942f6b0
commit c4188468e4
4 changed files with 172 additions and 99 deletions

View File

@ -3,7 +3,7 @@ import request from "@/utils/request.js";
/**
* 获取产品详情
* @param int id
*
*
*/
export function getProductDetail(id) {
return request.get('store/product/detail/' + id, {}, {
@ -13,7 +13,7 @@ export function getProductDetail(id) {
/**
* 获取产品详情参数
* @param int id
*
*
*/
export function getProductParmas(id) {
return request.get('store/product/show/' + id, {}, {
@ -23,7 +23,7 @@ export function getProductParmas(id) {
/**
* 获取预览商品详情
* @param int id
*
*
*/
export function getPreviewProDetail(data) {
return request.get('store/product/preview', data, {
@ -55,14 +55,14 @@ export function collectDel(data) {
}
/**
* 购车添加
*
*
*/
export function postCartAdd(data) {
return request.post('user/cart/create', data);
}
/**
* 获取分类列表
*
*
*/
export function getCategoryList() {
return request.get('store/product/category/lst', {}, {
@ -110,7 +110,7 @@ export function getBrandlist(data) {
}
/**
* 获取推荐产品
*
*
*/
export function getProductHot(page, limit) {
return request.get("product/spu/recommend", {
@ -122,7 +122,7 @@ export function getProductHot(page, limit) {
}
/**
* 获取商户推荐产品
*
*
*/
export function getMerProductHot(id,data) {
return request.get(`product/spu/recommend`, {
@ -135,17 +135,17 @@ export function getMerProductHot(id,data) {
}
/**
* 批量收藏
*
*
* @param object id
* @param string category
* @param string category
*/
export function collectAll(data) {
return request.post('user/relation/batch/create', data);
}
/**
* 首页产品的轮播图和产品信息
* @param int type
*
* @param int type
*
*/
export function getGroomList(type, data) {
return request.get('product/spu/hot/' + type, data, {
@ -170,7 +170,7 @@ export function userCollectDel(data) {
* 获取产品评论
* @param int id
* @param object data
*
*
*/
export function getReplyList(id, data) {
return request.get('store/product/reply/lst/' + id, data, {
@ -186,7 +186,7 @@ export function getReplyConfig(id) {
}
/**
* 获取搜索关键字获取
*
*
*/
export function getSearchKeyword() {
return request.get('common/hot_keyword', {}, {
@ -359,6 +359,10 @@ export function getHotBanner(type) {
export function create(data) {
return request.post("intention/create", data);
}
// 商户入驻表单 - 判断管理员是否有效
export function manageIsEligible(data) {
return request.get("intention/manageIsEligible", data);
}
/**
* 商户入驻短信验证码
* @returns {*}
@ -369,7 +373,7 @@ export function verify(data) {
/**
* 获取秒杀商品详情
* @param int id
*
*
*/
export function getSeckillProductDetail(id) {
return request.get('store/product/seckill/detail/' + id, {}, {
@ -379,7 +383,7 @@ export function getSeckillProductDetail(id) {
/**
* 获取秒杀商品详情参数
* @param int id
*
*
*/
// export function getSeckillProductParmas(id) {
// return request.get('store/product/seckill/show/' + id, {}, {
@ -416,7 +420,7 @@ export function merClassifly() {
/**
* 获取预售商品详情
* @param int id
*
*
*/
export function getPresellProductDetail(id) {
return request.get('store/product/presell/detail/' + id, {}, {
@ -426,7 +430,7 @@ export function getPresellProductDetail(id) {
/**
* 获取商户申请记录
* @param int id
*
*
*/
export function getApplicationRecordList(data) {
return request.get('intention/lst', data);
@ -434,7 +438,7 @@ export function getApplicationRecordList(data) {
/**
* 获取商户申请详情
* @param int id
*
*
*/
export function getGoodsDetails(id) {
return request.get('intention/detail/' + id, {});
@ -443,7 +447,7 @@ export function getGoodsDetails(id) {
/**
* 修改入驻信息
* @param int id
*
*
*/
export function updateGoodsRecord(id, data) {
return request.post('intention/update/' + id, data);
@ -451,7 +455,7 @@ export function updateGoodsRecord(id, data) {
/**
* 获取定位详细地址
* @param int id
*
*
*/
export function getGeocoder(data) {
return request.get(`lbs/geocoder?location=${data.lat},${data.long}`, {}, {
@ -461,7 +465,7 @@ export function getGeocoder(data) {
/**
* 获取店铺类型
* @param int id
*
*
*/
export function getStoreTypeApi() {
return request.get('intention/type', {}, {
@ -470,7 +474,7 @@ export function getStoreTypeApi() {
}
/**
* 到货通知
*
*
*/
export function arrivalNoticeApi(data) {
return request.post('store/product/increase_take',data);
@ -478,7 +482,7 @@ export function arrivalNoticeApi(data) {
/*
获取图片验证码
*/
*/
export function getCaptcha() {
return request.get('captcha');
}
@ -540,4 +544,4 @@ export function priceRuleApi(id) {
return request.get(`store/product/price_rule/${id}`, {}, {
noAuth: true
});
}
}

View File

@ -3,14 +3,18 @@ import request from "@/utils/request.js";
import Cache from '@/utils/cache'
/**
* 获取用户信息
*
*
*/
export function getUserInfo() {
return request.get('user');
}
// 搜索用户
export function searchUser(data) {
return request.get('searchUser',data);
}
/**
* 头像
*
*
*/
export function editAvatar(data) {
return request.post('user/change/info',data);
@ -108,7 +112,7 @@ export function getSignUser() {
/**
* 获取签到配置
*
*
*/
export function getSignConfig() {
return request.get('sign/config')
@ -130,14 +134,14 @@ export function setSignIntegral() {
/**
* 签到列表(年月)
* @param object data
*
*
*/
export function getSignMonthList(data) {
return request.get('user/sign/month', data)
}
/**
* 活动状态
*
*
*/
export function userActivity() {
return request.get('user/activity');
@ -162,7 +166,7 @@ export function getIntegralList(data) {
}
/**
* 获取分销海报图片
*
*
*/
export function spreadBanner() {
//#ifdef H5
@ -185,7 +189,7 @@ export function spreadPeople(data) {
return request.get('user/spread_list', data);
}
/**
*
*
* 推广佣金/提现总和
* @param int type
*/
@ -199,7 +203,7 @@ export function getSpreadInfo() {
return request.get("/commission");
}
/**
*
*
* 推广订单
* @param object data
*/
@ -227,14 +231,14 @@ export function extractCash(data) {
}
/**
* 提现银行/提现最低金额
*
*
*/
export function extractBank() {
return request.get('user/extract/banklst');
}
/**
* 会员等级列表
*
*
*/
export function userLevelGrade() {
return request.get('user/level/grade');
@ -248,13 +252,13 @@ export function userLevelTask(id) {
}
/**
* 检查用户是否可以成为会员
*
*
*/
export function userLevelDetection() {
return request.get('user/level/detection');
}
/**
*
*
* 地址列表
* @param object data
*/
@ -278,14 +282,14 @@ export function editAddress(data) {
/**
* 删除地址
* @param int id
*
*
*/
export function delAddress(id) {
return request.post('user/address/delete/' + id)
}
/**
* 获取单个地址
* @param int id
* @param int id
*/
export function getAddressDetail(id) {
return request.get('user/address/detail/' + id);
@ -305,14 +309,14 @@ export function getLogout() {
}
/**
* 佣金转入
*
*
*/
export function rechargeBrokerage(data) {
return request.post('user/recharge/brokerage', data)
}
/**
* 小程序充值
*
*
*/
export function rechargeRoutine(data) {
return request.post('recharge/routine', data)
@ -325,7 +329,7 @@ export function rechargeWechat(data) {
}
/**
* 获取默认地址
*
*
*/
export function getAddressDefault() {
return request.get('address/default');
@ -484,35 +488,35 @@ export function invoiceDetail(id) {
}
/**
* 新版分享海报信息获取
*
*
*/
export function spreadMsg(data) {
return request.get('user/v2/spread_image', data);
}
/**
* 图片链接转base64
*
*
*/
export function imgToBase(data) {
return request.post('common/base64', data);
}
/**
* 获取协议
*
*
*/
export function getAgreementApi(key) {
return request.get('agreement/'+key,{},{noAuth: true});
}
/**
* 获取协议
*
*
*/
export function getIntegralInfo() {
return request.get('user/integral/info');
}
/**
* 获取店铺列表
*
*
*/
export function getStoreList(data) {
return request.get('user/services', data);
@ -562,7 +566,7 @@ export function memberInfo() {
/**
* 成长值记录
* @param object data
*
*
*/
export function growthValueRecord(data) {
return request.get('user/member/log', data)
@ -570,7 +574,7 @@ export function growthValueRecord(data) {
/**
* 协议规则列表
* @param object data
*
*
*/
export function cacheLst() {
return request.get('agreement_lst',{}, {noAuth: true})
@ -578,7 +582,7 @@ export function cacheLst() {
/**
* 协议规则列表对应的数据
* @param object data
*
*
*/
export function cacheInfo(key) {
return request.get(`agreement/${key}`,{}, {noAuth: true})
@ -586,7 +590,7 @@ export function cacheInfo(key) {
/**
* 注销账户
* @param object data
*
*
*/
export function userOut(data) {
return request.post(`user/cancel`, data)
@ -594,7 +598,7 @@ export function userOut(data) {
/**
* 获取聊天用户信息
* @param object data
*
*
*/
export function serviceUser(merId, uid) {
return request.get(`service/user/${merId}/${uid}`)
@ -602,7 +606,7 @@ export function serviceUser(merId, uid) {
/**
* 保存聊天用户备注
* @param object data
*
*
*/
export function serviceSaveMark(merId, uid, mark) {
return request.post(`service/mark/${merId}/${uid}`, {mark})
@ -610,7 +614,7 @@ export function serviceSaveMark(merId, uid, mark) {
/**
* 获取会员卡类型
* @param object data
*
*
*/
export function memberCard() {
return request.get(`svip/pay_lst`)
@ -618,7 +622,7 @@ export function memberCard() {
/**
* 开通付费会员--支付
* @param object data
*
*
*/
export function memberCardCreate(id, data) {
return request.post(`svip/pay/${id}`, data)
@ -626,7 +630,7 @@ export function memberCardCreate(id, data) {
/**
* 付费会员权益
* @param object data
*
*
*/
export function memberEquity() {
return request.get(`svip/user_info`, {}, {noAuth: true})
@ -634,7 +638,7 @@ export function memberEquity() {
/**
* 付费会员优惠券
* @param object data
*
*
*/
export function memberCouponLst() {
return request.get(`svip/coupon_lst`, {}, {noAuth: true})
@ -642,7 +646,7 @@ export function memberCouponLst() {
/**
* 付费会员优惠券--领取
* @param object data
*
*
*/
export function receiveMemberCoupon(id) {
return request.post(`svip/coupon_receive/${id}`)
@ -650,7 +654,7 @@ export function receiveMemberCoupon(id) {
/**
* 付费会员--会员商品
* @param object data
*
*
*/
export function groomList(data) {
return request.get(`svip/product_lst`, data, {noAuth: true})
@ -658,7 +662,7 @@ export function groomList(data) {
/**
* 客服聊天--撤回消息
* @param object data
*
*
*/
export function chatReverstApi(id) {
return request.post(`service/recall/${id}`)
@ -666,7 +670,7 @@ export function chatReverstApi(id) {
/**
* 客服聊天--判断店铺是否有在线客服
* @param object data
*
*
*/
export function hasServiceApi(id) {
return request.get(`has_service/${id}`)
@ -674,7 +678,7 @@ export function hasServiceApi(id) {
/**
* 银行卡提现--银行卡信息
* @param object data
*
*
*/
export function getBankInfo() {
return request.get(`user/extract/history_bank`)

View File

@ -561,7 +561,7 @@
{
"path": "online_payment/record/quota",
"style": {
"navigationBarTitleText": "酒卡变更记录"
"navigationBarTitleText": "酒卡额度变更记录"
}
},
{

View File

@ -10,6 +10,22 @@
<text class="iconfont icon-xiangyou"></text>
</view>
<view class='list'>
<view class="item">
<view class="acea-row row-middle">
<text class="item-name">管理员</text>
<input type="text" placeholder="请输入用户UID/手机号" v-model="manage_search" />
</view>
<view v-if="manage_info.uid > 0" class="manage-info">
<view class="left">
<image class="left-image" :src="manage_info.avatar" />
</view>
<view class="right">
<view class="nickname">{{ manage_info.nickname || manage_info.real_name || manage_info.uid }}</view>
<view class="uid">UID{{ manage_info.uid }}</view>
</view>
</view>
<view v-if="manage_info.uid > 0 && !manage_eligible.is_eligible" class="manage-error">{{ manage_eligible.msg }}</view>
</view>
<view class="item">
<view class="acea-row row-middle">
<text class="item-name">商户名称</text>
@ -129,18 +145,8 @@
</template>
<script>
import {
create,
verify,
merClassifly,
getGoodsDetails,
updateGoodsRecord,
getStoreTypeApi
} from '@/api/store.js';
import {
getCaptcha,
getAgreementApi
} from "@/api/user";
import { manageIsEligible,create, verify, merClassifly, getGoodsDetails, updateGoodsRecord, getStoreTypeApi} from '@/api/store.js';
import {getCaptcha, getAgreementApi, searchUser} from "@/api/user";
import { mapGetters } from "vuex";
import { configMap } from "@/utils";
import parser from "@/components/jyf-parser/jyf-parser";
@ -148,6 +154,7 @@
import Verify from '@/components/verify/verify.vue';
import { HTTP_REQUEST_URL } from '@/config/app';
import spread from "../../../libs/spread";
const app = getApp();
export default {
components: {
@ -170,7 +177,14 @@
showProtocol: false,
isShowCode: false,
loading: false,
manage_info: {},
manage_eligible:{
is_eligible: true,
msg: '',
},
manage_search: '',
merchantData: {
manage_uid: '',
enterprise_name: "",
user_name: "",
phone: "",
@ -229,6 +243,31 @@
},
onShow() {},
onReady() {},
watch: {
'manage_search':{
handler(val) {
let _this = this;
searchUser({ id_and_phone: _this.manage_search}).then(res => {
_this.manage_info = res.data;
_this.merchantData.manage_uid = res.data.uid;
}).catch(err => {});
},
deep: false
},
'merchantData.manage_uid':{
handler(val) {
let _this = this;
let params = {
manage_uid: _this.merchantData.manage_uid,
mer_intention_id: _this.mer_i_id
};
manageIsEligible(params).then(res => {
_this.manage_eligible = res.data;
}).catch(err => {});
},
deep: false
}
},
methods: {
getConfig() {
this.isType = false;
@ -256,6 +295,9 @@
this.merchantData.phone = resData.phone
this.merchantData.classification = resData.merchant_category_id
this.merchantData.mer_type = resData.mer_type_id
//
this.merchantData.manage_uid = resData.manage_uid || ''
this.manage_search = Number(this.merchantData.manage_uid) || ''
})
this.pics = resData.images
this.mer_classification = this.getCategoryName(resData.merchant_category_id, this.array)
@ -456,6 +498,7 @@
if (that.validateForm() && that.validate) {
let requestData = {
phone: that.merchantData.phone,
manage_uid: that.merchantData.manage_uid,
mer_name: that.merchantData.enterprise_name,
name: that.merchantData.user_name,
code: that.merchantData.yanzhengma,
@ -521,30 +564,16 @@
validateForm: function() {
let that = this,
value = that.merchantData;
if (!value.enterprise_name) return that.$util.Tips({
title: '请输入企业名称'
});
if (!value.user_name) return that.$util.Tips({
title: '请输入姓名'
});
if (!value.phone) return that.$util.Tips({
title: '请输入手机号'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(value.phone)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (!value.yanzhengma) return that.$util.Tips({
title: '请填写验证码'
});
if (!value.classification) return that.$util.Tips({
title: '请选择商户分类'
});
if (!that.isAgree) return that.$util.Tips({
title: '请勾选并同意入驻协议'
});
if (that.isShowCode && !that.codeVal) return that.$util.Tips({
title: '请填写图片验证码'
});
if (!value.manage_uid) return that.$util.Tips({title: '请设置管理员'});
else if (value.manage_uid && !that.manage_eligible.is_eligible) return that.$util.Tips({title: '请设置有效管理员'});
if (!value.enterprise_name) return that.$util.Tips({title: '请输入企业名称'});
if (!value.user_name) return that.$util.Tips({title: '请输入姓名'});
if (!value.phone) return that.$util.Tips({title: '请输入手机号'});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(value.phone)) return that.$util.Tips({title: '请输入正确的手机号码'});
if (!value.yanzhengma) return that.$util.Tips({title: '请填写验证码'});
if (!value.classification) return that.$util.Tips({title: '请选择商户分类'});
if (!that.isAgree) return that.$util.Tips({title: '请勾选并同意入驻协议'});
if (that.isShowCode && !that.codeVal) return that.$util.Tips({title: '请填写图片验证码'});
that.validate = true;
return true;
},
@ -601,6 +630,42 @@
</script>
<style scoped lang="scss">
.manage-info {
width: 100%;
margin-top: 20rpx;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: flex-start;
.left {
width: 100rpx;
text-align: left;
.left-image {
width: 90rpx;
height: 90rpx;
border-radius: 50%;
}
}
.right {
width: calc(100% - 100rpx);
.nickname {
width: 100%;
font-size: 30rpx;
font-weight: bold;
}
.uid {
width: 100%;
}
}
}
.manage-error{
color: #f56c6c;
font-size: 24rpx;
}
/deep/checkbox .uni-checkbox-input.uni-checkbox-input-checked,
/deep/checkbox .wx-checkbox-input.wx-checkbox-input-checked {
border: 1px solid var(--view-theme)!important;
@ -645,7 +710,7 @@
position: absolute;
top: 300rpx;
width: calc(100% - 30px);
}
.application-record {
position: absolute;