zhaoxiaoqiang
2021-08-31 20365ba048f4042dfdc223cf2a6fa8c2d5a699f3
接口修改
3 files modified
257 ■■■■■ changed files
src/api/index.js 187 ●●●●● patch | view | raw | blame | history
src/views/mine/stores/stores-add.vue 2 ●●● patch | view | raw | blame | history
src/views/mine/toggle-identity.vue 68 ●●●● patch | view | raw | blame | history
src/api/index.js
@@ -6,72 +6,69 @@
 * @LastEditTime: 2021-01-04 09:34:57
 */
import $http from './config';
import oldapi from './oldapi';
import $http from "./config";
import oldapi from "./oldapi";
const api = {
    ...oldapi,
    // 获取微信配置
    getTokenInfo(data) {
        data.apploading = 1;
        return $http.post('/wechat/getSign', data);
    return $http.post("/wechat/getSign", data);
    },
    // 获取微信token
    getWeChatUserInfo(data) {
        return $http.post('/wechat/userInfo', data);
    return $http.post("/wechat/userInfo", data);
    },
    setUserOpenId(data) {
        return Service.post('/wechat/binding', data);
    return Service.post("/wechat/binding", data);
    },
    //token登陆
    loginByToken(data) {
        return $http.post('/login/loginByToken', data);
    return $http.post("/login/loginByToken", data);
    },
    loginByMerToken(data){
        return $http.post('/login/loginByMerToken',data);
    return $http.post("/login/loginByMerToken", data);
    },
    //登陆
    login(data) {
        return $http.post('/login/login', data);
    return $http.post("/login/hwf/login", data);
    },
    //登出
    logout(data) {
        return $http.post('/login/logout', data);
    return $http.post("/login/logout", data);
    },
    // 获取角色列表
    getRole(data) {
        return $http.post('/user/getUserMgrInfo', data);
    return $http.post("/user/hwf/getUserMgrInfo", data);
    },
    getAgencyMerList(data){
        return $http.post('/user/getAgencyMerList',data)
    return $http.post("/user/getAgencyMerList", data);
    },
    // 获取用户信息
    getPowerInfo(mgrId) {
        return $http.post('/user/mgr/powerInfo', {
            mgrId
    return $http.post("/user/mgr/powerInfo", {
      mgrId,
        });
    },
    // 账户管理——获取用户信息
    getUserDetail(mgrId) {
        return $http.post('/user/mgr/detail', {
            mgrId
    return $http.post("/user/mgr/detail", {
      mgrId,
        });
    },
    //修改密码
    userUpdatePwd(data) {
      return $http.post('/user/updatePwd', data);
    return $http.post("/user/updatePwd", data);
    },
    //获取验证码
    userSendMsg(data) {
      return $http.post('/user/sendMsg', data);
    return $http.post("/user/sendMsg", data);
    },
    //忘记密码
      userForgetPwd(data) {
        return $http.post('/user/forgetPwd', data);
    return $http.post("/user/forgetPwd", data);
      },
    // 获取地区列表/sib/public/cmccAreaList
    // getArea() {获取所有省市区列表
@@ -82,280 +79,258 @@
    // },
    getArea() {
        let data = {
            apploading:1
      apploading: 1,
        };
        return $http.post('/public/cmccAreaList',data);
    return $http.post("/public/cmccAreaList", data);
    },
    // 获取机构拥有的地区列表
    getOrgAreaInfo(orgType) {
        let data = {
            apploading:1,
            orgType
      orgType,
        };
        return  $http.post('/public/getOrgAreaInfo', data);
    return $http.post("/public/getOrgAreaInfo", data);
    },
    /**
     * 渠道相关
     */
    //列表
    getChannel() {
        return $http.post('/chan/chanList');
    return $http.post("/chan/chanList");
    },
    //添加
    addChan(data) {
        return $http.post('/chan/addChan', data);
    return $http.post("/chan/addChan", data);
    },
    //切换状态
    channSwitchStatus(data) {
        return $http.post('/chan/switchStatus', data);
    return $http.post("/chan/switchStatus", data);
    },
    //更新渠道详细信息
    updateChan(data) {
        return $http.post('/chan/updateChan', data);
    return $http.post("/chan/updateChan", data);
    },
    //查看/加载渠道详细信息
    getChannelInfo(chanId) {
        return $http.post('/chan/viewChanInf', {chanId});
    return $http.post("/chan/viewChanInf", { chanId });
    },
    // 获取审批列表
    getAuditList(data) {
        return $http.post('/merchant/auditList', data);
    return $http.post("/merchant/auditList", data);
    },
    //审批商户
    merAudit(data){
        return $http.post('/merchant/audit', data);
    return $http.post("/merchant/audit", data);
    },
    // /merchant/auditList
    getAuditType(data){
        return $http.post('/merchant/auditType', data);
    return $http.post("/merchant/auditType", data);
    },
    setAuditType(data){
        return $http.post('/merchant/setAuditType', data);
    return $http.post("/merchant/setAuditType", data);
    },
    /**
     * 门店管理相关
     */
    //门店列表
    storeStoreList(data) {
        return $http.post('/store/storeList', data);
    return $http.post("/store/storeList", data);
    },
    storeStorePersonList(data) {
        return $http.post('/agency/userList', data);
    return $http.post("/agency/userList", data);
    },
    //门店详情
    storeDtl(data) {
        return $http.post('/store/dtl', data);
    return $http.post("/store/dtl", data);
    },
    //编辑门店
    storeEdit(data) {
        return $http.post('/store/edit', data);
    return $http.post("/store/edit", data);
    },
    //添加门店
    storeAdd(data) {
        return $http.post('/store/add', data);
    return $http.post("/store/add", data);
    },
    agencyAddUser(data){
        return $http.post('/agency/addUser', data);
    return $http.post("/agency/addUser", data);
    },
    // 数据查询相关
    //获取产品列表
    getProductList(data) {
        return $http.post('/prod/typeList', data);
    return $http.post("/prod/typeList", data);
    },
    // 获取订单初始化数据
    getOrderInit(data) {
        return $http.post('/order/init', data);
    return $http.post("/order/init", data);
    },
    // 账号管理——列表
    getMgrList(data) {
        return $http.post('/user/getMgrList', data);
    return $http.post("/user/getMgrList", data);
    },
    // 账户管理——冻结账户
    userFreezeMgr(mgrId){
        return $http.post('/user/freezeMgr', {mgrId});
    return $http.post("/user/freezeMgr", { mgrId });
    },
    // 账户管理——增加账户
    userAdd(data){
        return $http.post('/user/add', data);
    return $http.post("/user/add", data);
    },
    // 账户管理——更新账户信息
    userUpdate(data){
        return $http.post('/user/update', data);
    return $http.post("/user/update", data);
    },
    // 花呗订单列表
    getHBList(data){
        return $http.post('/order/hbList', data);
    return $http.post("/order/hbList", data);
    },
    // 获取花呗订单详情
    getHBDetail(orderId){
        return $http.post('/order/hbOrderDtl', {orderId});
    return $http.post("/order/hbOrderDtl", { orderId });
    },
    // 花呗订单——退款
    hbOrderRefund(data){
        return $http.post('/hbOrder/refund', data);
    return $http.post("/hbOrder/refund", data);
    },
    // 花呗——订单导出
    hbExport(data){
        return $http.post('/order/hbExport', data);
    return $http.post("/order/hbExport", data);
    },
    // 获取产品订单金额统计
    getAmtReport(prodId){
        return $http.post('/order/amtReport', {prodId});
    return $http.post("/order/amtReport", { prodId });
    },
    //获取周次商户统计
    getMerWeeksReport(){
        return $http.post('/merchant/weeksReport');
    return $http.post("/merchant/weeksReport");
    },
    // 商户统计
    getMerReport(data){
        return $http.post('/merchant/report',data);
    return $http.post("/merchant/report", data);
    },
    // 获取订单统计
    getOrderReport(data){
        return $http.post('/order/report',data);
    return $http.post("/order/report", data);
    },
    //获取商户列表
    merList(data) {
        return $http.post('/merchant/list', data);
    return $http.post("/merchant/list", data);
    },
    //商户详情
    merDetail(data) {
        return $http.post('/merchant/merDetail', data);
    return $http.post("/merchant/merDetail", data);
    },
    //商户照片信息
    merFile(data) {
        return $http.post('/merchant/file', data);
    return $http.post("/merchant/file", data);
    },
    //商户列表导出
    merExport(data) {
        return $http.post('/merchant/export', data);
    return $http.post("/merchant/export", data);
    },
    getUnAuditNb(data){
        return $http.post('/merchant/unAuditNb',data);
    return $http.post("/merchant/unAuditNb", data);
    },
    // 信用卡分期订单
    getCreditOrderList(data){
        return $http.post('/order/list', data);
    return $http.post("/order/list", data);
    },
    // 信用卡分期 导出
    creditExport(data){
        return $http.post('/order/export', data);
    return $http.post("/order/export", data);
    },
    // 信用卡分期 详情
    getCreditDetail(orderId){
        return $http.post('/order/orderDtl', {orderId});
    return $http.post("/order/orderDtl", { orderId });
    },
    //商户注册
    merRegist(data) {
        return $http.post('/user/regist', data);
    return $http.post("/user/hwf/regist", data);
    },
    // 商户筛选条件初始化
    merInitFilter(data){
        return $http.post('/merchant/initFilter', data);
    return $http.post("/merchant/initFilter", data);
    },
    // 模板列表
    getTempList(data){
        return $http.post('/temp/tempList', data);
    return $http.post("/temp/tempList", data);
    },
    // 模板 初始化数据
    // getTempInit(){
    //     return $http.post('/temp/init');
    // },
    getTempInit(data){
        return $http.post('/tempManager/init',data);
    return $http.post("/tempManager/init", data);
    },
    // 模板详情
    // getTempDetail(tempId){
    //     return $http.post('/temp/detail',{tempId});
    // },
    getTempDetail(tempId){
        return $http.post('/tempManager/detail',{tempId});
    return $http.post("/tempManager/detail", { tempId });
    },
    //模板——保存
    // tempSave(data){
    //     return $http.post('/temp/save',data);
    // },
    tempSave(data){
        return $http.post('/tempManager/save',data);
    return $http.post("/tempManager/save", data);
    },
    tempManagerUpdate(data){
        return $http.post('/tempManager/update',data)
    return $http.post("/tempManager/update", data);
    },
    //模板——商户保存
    tempSaveMerTemp(data){
        return $http.post('/temp/saveMerTemp',data);
    return $http.post("/temp/saveMerTemp", data);
    },
    getTempMerRef(data){
        return $http.post('/temp/getTempMerRef',data);
    return $http.post("/temp/getTempMerRef", data);
    },
    tempGetMerRef(data){
        return $http.post('/temp/getMerRef',data);
    return $http.post("/temp/getMerRef", data);
    },
    //模板——商户列表
    getTempMerList(data){
        return $http.post('/temp/tempMerList',data);
    return $http.post("/temp/tempMerList", data);
    },
    //模板 保存商户分配模板
    saveMerListTemp(data){
        return $http.post('/temp/saveMerListTemp',data);
    return $http.post("/temp/saveMerListTemp", data);
    },
    // 微信扫码登录
    loginByOpenId(data){
        return $http.post('/login/loginByOpenId',data)
    return $http.post("/login/loginByOpenId", data);
    },//openid登录
    checkOpenIdIsBind(data){
        return $http.post('/user/checkOpenIdIsBind',data)
    return $http.post("/user/checkOpenIdIsBind", data);
    },//判断是否绑定openId
    userAddStoreManager(data){
        return $http.post('/user/addStoreManager',data)
    return $http.post("/user/addStoreManager", data);
    },//资料补充
    // ===========宁夏移动接入调整借口===============
    // 查询业务归属省份
    findProvNo(data){
        return $http.post('/cmccWxpay/findProvNo',data)
    return $http.post("/cmccWxpay/findProvNo", data);
    },
    //创建订单并且返回二维码/cmccWxpay/nx/create
    nxCreate(data){
        return $http.post('/cmccWxpay/nx/create',data)
    return $http.post("/cmccWxpay/nx/create", data);
    },
    // 生成二维码初始化/sib/cmccWxpay/nx/init
    nxInit(data){
        return $http.post('/cmccWxpay/nx/init',data)
    return $http.post("/cmccWxpay/nx/init", data);
    },
    // // 授权结果推送/cmccWxpay/nx/pushOrderStatus
    // pushOrderStatus(data){
@@ -367,12 +342,12 @@
    // },
    // 检验手机号是否可用/cmccWxpay/nx/verifyMblNo
    nxVerifyMblNo(data){
        return $http.post('/cmccWxpay/nx/verifyMblNo',data)
    return $http.post("/cmccWxpay/nx/verifyMblNo", data);
    },
}
};
export default {
    install(Vue, opt) {
        Vue.prototype.$api = api;
    }
}
  },
};
src/views/mine/stores/stores-add.vue
@@ -12,7 +12,7 @@
          <div v-if="form.areaText">{{ form.areaText }}</div>
          <div v-else style="color: #a2a2a2">请选择</div>
          <svg class="icon" aria-hidden="true" style="width:18px;height:18px;fill:#999;">
            <use xlink:href="#iconyou"></use>
            <use xlink:href="#iconyou" />
          </svg>
        </div>
      </v-cell>
src/views/mine/toggle-identity.vue
@@ -23,7 +23,7 @@
                            <svg class="icon" aria-hidden="true"  style="width:15px;height:15px;">
                                <use xlink:href="#iconshijian"></use>
                            </svg>
                            <time class='time'>创建时间:{{role.creTime | timeformat('yyyy-MM-dd HH:mm:ss')}}</time>
              <time class="time">创建时间:{{ role.creTime | timeformat("yyyy-MM-dd HH:mm:ss") }}</time>
                        </p>
                    </div>
                    <div @click="setRole(role)" v-if="role.status == 1 && role.supStatus == 1" >
@@ -37,84 +37,80 @@
</template>
<script>
import { mapActions, mapState } from 'vuex';
import { mapActions, mapState } from "vuex";
    export default {
        data() {
            return {
                roleList: [],//角色列表
                roleId: '',//radio的value
                role:null //当前选中的角色
            }
      roleId: "", //radio的value
      role: null, //当前选中的角色
    };
        },
        computed:{
            ...mapState(['userinfo'])
    ...mapState(["userinfo"]),
        },
        created() {
            this.roleId = this.userinfo.id;
            if(sessionStorage.isLoginByOpenId == 1){
                this.roleList = [{
                    title:'门店',
                    arr:JSON.parse(localStorage.storeList)
                }]
      this.roleList = [
        {
          title: "门店",
          arr: JSON.parse(localStorage.storeList),
        },
      ];
            }else{
                this.getRole();
            }
        },
        methods: {
            ...mapActions(['setUserMenu']),
    ...mapActions(["setUserMenu"]),
            // 设置当前选中的角色
            setRole(role){
                this.role = role;
            },
            // 获取角色
            getRole() {
                this.$api.getRole().then((res) => {
                    let {
                        agencyList,
                        chanList,
                        merchantList,
                        storeList
                    } = res.body;
      this.$api
        .getRole()
        .then((res) => {
          let { agencyList, chanList, merchantList, storeList } = res.body;
                    this.roleList.push({
                        title:'代理',
                        arr:agencyList || []
            title: "代理",
            arr: agencyList || [],
                    });
                    this.roleList.push({
                        title:'渠道',
                        arr:chanList || []
            title: "渠道",
            arr: chanList || [],
                    });
                    this.roleList.push({
                        title:'商户',
                        arr:merchantList || []
            title: "商户",
            arr: merchantList || [],
                    });
                    this.roleList.push({
                        title:'门店',
                        arr:storeList || []
            title: "门店",
            arr: storeList || [],
                    });
                }).catch((err) => {
                });
        })
        .catch((err) => {});
            },
            // 获取用户信息
            getRoleInfo(){
                if(!this.roleId){
                     this.$notify('请选择登录角色');
                    return
        this.$notify("请选择登录角色");
        return;
                }
                this.setUserMenu({
                    vm:this,
                    lastLoginMgrId:this.roleId,
                })
      });
                // this.$api.getPowerInfo(this.roleId).then((res) => {
                // }).catch((err) => {
                // });
            }
        },
    }
  },
};
</script>
<style lang="less" scoped>