新增小程序
This commit is contained in:
parent
0f11c59662
commit
cb61ea0017
18
api/uniMP.js
Normal file
18
api/uniMP.js
Normal file
@ -0,0 +1,18 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
import request from "@/utils/request.js";
|
||||
|
||||
/**
|
||||
* 获取供销平台版本信息
|
||||
*/
|
||||
export function getGXconfig(data) {
|
||||
return request.get("global/config", data);
|
||||
}
|
||||
|
@ -27,7 +27,10 @@
|
||||
"Geolocation" : {},
|
||||
"Payment" : {},
|
||||
"Share" : {},
|
||||
"OAuth" : {}
|
||||
"OAuth" : {},
|
||||
"UniMP" : {
|
||||
"description" : "uni小程序"
|
||||
}
|
||||
},
|
||||
"safearea" : {
|
||||
"bottom" : {
|
||||
|
12
pages.json
12
pages.json
@ -94,8 +94,16 @@
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
|
||||
}
|
||||
],
|
||||
}, {
|
||||
"path" : "pages/moreProject/moreProject",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText": "更多功能",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
],
|
||||
"subPackages": [{
|
||||
"root": "pages/goods_cate",
|
||||
"name": "goods_cate",
|
||||
|
@ -17,242 +17,42 @@
|
||||
<zbpSwiper :isSelectPlace="true" :location_Arr="locationArr" @kkchange='kkchange'></zbpSwiper>
|
||||
<u-empty :show="jurisdiction" marginTop="260" mode="permission" :text="emptyText"
|
||||
icon="http://cdn.uviewui.com/uview/empty/permission.png"></u-empty>
|
||||
<block v-if="isShow">
|
||||
<view class="special_work com" v-if="userInfoData.mer_info.type_id === 12">
|
||||
<view class="special_work com" v-if="true">
|
||||
<view class="title">市级供应链</view>
|
||||
<view class="content">
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/nongKe/supply_chain/goods_list?merid=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}zsgl.png`" mode="aspectFill"></image>
|
||||
<text class="text">在售管理</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/admin/order/index?mer_id=${mer_id}&product_type=98&type_id=${userInfoData.mer_info.type_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}cwgl.png`" mode="aspectFill"></image>
|
||||
<text class="text">财务管理</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/nongKe/gather/select_warehouse?mer_id=${mer_id}&stype=1`)">
|
||||
<image class="icon_img" :src="`${prefix}rkgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">入库管理</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/product/basicSet?mer_id=${mer_id}&product_type=98`, '商户设置')">
|
||||
<image class="icon_img" :src="`${prefix}shsz.png`" mode="aspectFill"></image>
|
||||
<text class="text">商户设置</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator(`/pages/product/list/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}spgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">商品管理</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator(`/pages/users/embody/embody?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}txgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">提现管理</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/admin/order_cancellation/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}ddhx.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">订单核销</text>
|
||||
</view>
|
||||
<!-- <view class="examine" @click="navigator(`/pages/nongKe/teach_video/teach_video`)">
|
||||
<image class="icon_img"
|
||||
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/spjs.png" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">视频教学</text>
|
||||
</view> -->
|
||||
<!-- <view class="examine" @click="navigator(`/pages/users/user_invoice_Finance/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" src="@/static/images/cwgk.png" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">财务公开</text>
|
||||
</view> -->
|
||||
<!-- <view class="examine" @click="navigator(`/pages/admin/order/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}ddgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">订单管理</text>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="business com" v-if="userInfoData.mer_info.type_id === 10">
|
||||
<view class="business com" v-if="true">
|
||||
<view class="special_work com">
|
||||
<view class="title">我的店铺</view>
|
||||
<view class="content ">
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/users/supply_procurement/index?type_id=12&isDetail=1&product_type=98&cate_id=${userInfoData.mer_info.category_id}`)">
|
||||
<!-- @click="navigator(`/pages/nongKe/supply_chain/supplier?type_id=12&isDetail=1&product_type=98&cate_id=${userInfoData.mer_info.category_id}`) -->
|
||||
<image class="icon_img" :src="`${prefix}ghcg.png`" mode="aspectFill"></image>
|
||||
<text class="text">供货采购</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator('/pages/users/order_list/indexCopy?status=-1&product_type=98')">
|
||||
<image class="icon_img" :src="`${prefix}jhgl.png`" mode="aspectFill"></image>
|
||||
<text class="text">进货管理</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator(`/pages/admin/stockOut/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}smck.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">扫码出库</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/nongKe/gather/select_warehouse?mer_id=${mer_id}&stype=2`)">
|
||||
<image class="icon_img" :src="`${prefix}rkgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">入库管理</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator(`/pages/users/embody/embody?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}txgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">提现管理</text>
|
||||
</view>
|
||||
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/chat/customer_list/index?type=1&mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}kfjl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">客服记录</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/admin/order_cancellation/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}ddhx.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">订单核销</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/admin/order/index?mer_id=${mer_id}&type_id=${userInfoData.mer_info.type_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}ddgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">订单管理</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator(`/pages/product/list/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}spgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">商品管理</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/product/basicSet?mer_id=${mer_id}`, '商户设置')">
|
||||
<image class="icon_img" :src="`${prefix}shsz.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">商户设置</text>
|
||||
</view>
|
||||
<!-- <view class="examine"
|
||||
@click="navigator(`/pages/users/trading_hall/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" src="@/static/images/diaohuo.png" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">交易大厅</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/commissionedSales/index/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" src="@/static/images/weituo.png" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">委托销售</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator(`/pages/releaseManagement/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" src="@/static/images/fabu.png" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">发布管理</text>
|
||||
</view> -->
|
||||
<!-- <view class="examine" @click="navigator(`/pages/users/user_invoice_Finance/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" src="@/static/images/cwgk.png" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">财务公开</text>
|
||||
</view> -->
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <gatherBusiness :userInfoData="userInfoData" /> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="business com" v-if="userInfoData.mer_info.type_id!=null&&userInfoData.mer_info.type_id === 11">
|
||||
<view class="business com" v-if="true">
|
||||
<view class="special_work com">
|
||||
<view class="title">里海云仓</view>
|
||||
<view class="content ">
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/nongKe/supply_chain/supplier?type_id=12&isDetail=1&product_type=98&cate_id=${userInfoData.mer_info.category_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}ghcg.png`" mode="aspectFill"></image>
|
||||
<text class="text">供货采购</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator('/pages/users/order_list/index?status=-1')">
|
||||
<image class="icon_img" :src="`${prefix}jhgl.png`" mode="aspectFill"></image>
|
||||
<text class="text">进货管理</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator(`/pages/admin/stockOut/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}smck.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">扫码出库</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/nongKe/gather/select_warehouse?mer_id=${mer_id}&stype=2`)">
|
||||
<image class="icon_img" :src="`${prefix}rkgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">入库管理</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator(`/pages/users/embody/embody?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}txgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">提现管理</text>
|
||||
</view>
|
||||
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/chat/customer_list/index?type=1&mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}kfjl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">客服记录</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/admin/order_cancellation/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}ddhx.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">订单核销</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/admin/order/index?mer_id=${mer_id}&type_id=${userInfoData.mer_info.type_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}ddgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">订单管理</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator(`/pages/product/list/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}spgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">商品管理</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/product/basicSet?mer_id=${mer_id}`, '商户设置')">
|
||||
<image class="icon_img" :src="`${prefix}shsz.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">商户设置</text>
|
||||
</view>
|
||||
<!-- <view class="examine" @click="navigator(`/pages/users/user_invoice_Finance/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" src="@/static/images/cwgk.png" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">财务公开</text>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</block>
|
||||
<!-- <m-tabbar native>
|
||||
<template v-slot:tabbar_index_2>
|
||||
<view class="custom_style">
|
||||
<view class="custom_style_icon"></view>
|
||||
</view>
|
||||
</template>
|
||||
</m-tabbar> -->
|
||||
<view class="business com special_work">
|
||||
<view class="title project">
|
||||
<view>更多功能</view>
|
||||
<view class="edit" @click="editFlag = !editFlag">{{editFlag?'完成':'编辑'}}</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<block v-if="nowMenuList.length>0">
|
||||
<u-transition v-for="(item, index) in nowMenuList" :key="item.name" show>
|
||||
<view class="examine" @click="editFlag?removeMenu(item):clickMenu(item.type, item.data)">
|
||||
<image class="icon_img" :src="`${prefix}${item.icon}`" mode="aspectFill">
|
||||
</image>
|
||||
<u-icon v-if="editFlag" class="icon" name="minus-circle-fill" color="red"></u-icon>
|
||||
<text class="text">{{item.name}}</text>
|
||||
</view>
|
||||
</u-transition>
|
||||
</block>
|
||||
<view v-else-if="!editFlag" @click="editFlag = true" style="text-align: center;width: 100%;color: #aaa;">还没有应用,点我添加应用</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="editFlag" class="business com special_work edit_card">
|
||||
<view class="title project" style="padding: 0 28rpx;">
|
||||
<view>编辑功能</view>
|
||||
<view class="edit2" @click="editComfirm">完成</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<u-transition v-for="(item, index) in AllMenuList" :key="item.name" show>
|
||||
<view class="examine" @click="pushMenu(item)">
|
||||
<image class="icon_img" :src="`${prefix}${item.icon}`" mode="aspectFill">
|
||||
</image>
|
||||
<u-icon class="icon" name="plus-circle-fill"></u-icon>
|
||||
<text class="text">{{item.name}}</text>
|
||||
</view>
|
||||
</u-transition>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="" v-if='jurisdiction==false&&isShow==false'>
|
||||
<emptyPage title="暂无信息"></emptyPage>
|
||||
</view>
|
||||
@ -286,7 +86,8 @@
|
||||
} from '@/libs/uniApi';
|
||||
import {
|
||||
getDiy
|
||||
} from '@/api/api.js'
|
||||
} from '@/api/api.js';
|
||||
import uniMP from '@/utils/uniMP.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -309,14 +110,34 @@
|
||||
isShow: false,
|
||||
bgColor: '',
|
||||
isFshow: false,
|
||||
street:''
|
||||
street:'',
|
||||
// 编辑中标记
|
||||
editFlag: false,
|
||||
// 所有菜单的按钮
|
||||
AllMenuList: [
|
||||
{
|
||||
name: '商户平台',
|
||||
icon: 'spgl.png',
|
||||
data: '/pages/moreProject/moreProject',
|
||||
type: 2,
|
||||
},
|
||||
{
|
||||
name: '供销平台',
|
||||
icon: 'shsz.png',
|
||||
data: '__UNI__B5B1EDD',
|
||||
type: 1,
|
||||
},
|
||||
],
|
||||
nowMenuList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo', 'location', 'isLogin'])
|
||||
},
|
||||
created() {},
|
||||
onLoad() {},
|
||||
onLoad() {
|
||||
this.initMenu();
|
||||
},
|
||||
onShow() {
|
||||
if (this.isLogin) {
|
||||
this.emptyText = '暂无可用应用'
|
||||
@ -338,8 +159,6 @@
|
||||
// 监听页面滚动事件
|
||||
window.addEventListener("scroll", this.scrolling);
|
||||
// #endif
|
||||
|
||||
|
||||
},
|
||||
// #ifdef APP-PLUS
|
||||
onPageScroll(e) {
|
||||
@ -355,7 +174,55 @@
|
||||
// #endif
|
||||
|
||||
methods: {
|
||||
appLocation() {
|
||||
// 初始化菜单
|
||||
initMenu(){
|
||||
let all = uni.getStorageSync('gatherAllMenuList');
|
||||
let now = uni.getStorageSync('gatherNowMenuList');
|
||||
if(all){
|
||||
this.AllMenuList = JSON.parse(all);
|
||||
}
|
||||
if(now){
|
||||
this.nowMenuList = JSON.parse(now);
|
||||
}
|
||||
},
|
||||
clickMenu(e, data){
|
||||
switch(e){
|
||||
case 1: this.getUniMp(data);break;
|
||||
case 2: this.navigator(data);break;
|
||||
}
|
||||
},
|
||||
// 添加菜单
|
||||
pushMenu(data){
|
||||
this.nowMenuList.push(data);
|
||||
this.AllMenuList = this.AllMenuList.filter((item)=>{
|
||||
return item.name!=data.name;
|
||||
})
|
||||
},
|
||||
// 移除菜单
|
||||
removeMenu(data){
|
||||
this.AllMenuList.push(data);
|
||||
this.nowMenuList = this.nowMenuList.filter((item)=>{
|
||||
return item.name!=data.name;
|
||||
})
|
||||
},
|
||||
// 编辑完成
|
||||
editComfirm(){
|
||||
this.editFlag = false;
|
||||
uni.setStorageSync('gatherAllMenuList', JSON.stringify(this.AllMenuList));
|
||||
uni.setStorageSync('gatherNowMenuList', JSON.stringify(this.nowMenuList));
|
||||
},
|
||||
getUniMp(appid){
|
||||
console.log('点击供销平台');
|
||||
// #ifdef APP-PLUS
|
||||
uniMP.loadMP(appid);
|
||||
return ;
|
||||
// #endif
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: 'H5不支持打开小程序'
|
||||
})
|
||||
},
|
||||
appLocation() {
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
timeout: '10',
|
||||
@ -544,6 +411,24 @@
|
||||
font-weight: 700;
|
||||
margin-bottom: 38.6rpx;
|
||||
}
|
||||
|
||||
.project{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-end;
|
||||
.edit{
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
&::after{
|
||||
content: '>';
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
.edit2{
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
@ -558,12 +443,19 @@
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
// margin: 0 0 33.33rpx 33.33rpx !important;
|
||||
|
||||
.icon_img {
|
||||
width: 63.16rpx;
|
||||
height: 63.16rpx;
|
||||
}
|
||||
|
||||
.icon{
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
right: 25rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 26.32rpx;
|
||||
@ -595,4 +487,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.edit_card{
|
||||
background-color: #fff;
|
||||
padding-top: 28rpx;
|
||||
}
|
||||
</style>
|
584
pages/moreProject/moreProject.vue
Normal file
584
pages/moreProject/moreProject.vue
Normal file
@ -0,0 +1,584 @@
|
||||
<template>
|
||||
<view class="gather">
|
||||
<block v-if="isShow">
|
||||
<view class="special_work com" v-if="userInfoData.mer_info.type_id === 12">
|
||||
<view class="special_work com" v-if="true">
|
||||
<view class="title">市级供应链</view>
|
||||
<view class="content">
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/nongKe/supply_chain/goods_list?merid=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}zsgl.png`" mode="aspectFill"></image>
|
||||
<text class="text">在售管理</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/admin/order/index?mer_id=${mer_id}&product_type=98&type_id=${userInfoData.mer_info.type_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}cwgl.png`" mode="aspectFill"></image>
|
||||
<text class="text">财务管理</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/nongKe/gather/select_warehouse?mer_id=${mer_id}&stype=1`)">
|
||||
<image class="icon_img" :src="`${prefix}rkgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">入库管理</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/product/basicSet?mer_id=${mer_id}&product_type=98`, '商户设置')">
|
||||
<image class="icon_img" :src="`${prefix}shsz.png`" mode="aspectFill"></image>
|
||||
<text class="text">商户设置</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator(`/pages/product/list/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}spgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">商品管理</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator(`/pages/users/embody/embody?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}txgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">提现管理</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/admin/order_cancellation/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}ddhx.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">订单核销</text>
|
||||
</view>
|
||||
<!-- <view class="examine" @click="navigator(`/pages/nongKe/teach_video/teach_video`)">
|
||||
<image class="icon_img"
|
||||
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/spjs.png" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">视频教学</text>
|
||||
</view> -->
|
||||
<!-- <view class="examine" @click="navigator(`/pages/users/user_invoice_Finance/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" src="@/static/images/cwgk.png" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">财务公开</text>
|
||||
</view> -->
|
||||
<!-- <view class="examine" @click="navigator(`/pages/admin/order/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}ddgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">订单管理</text>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="business com" v-if="userInfoData.mer_info.type_id === 10">
|
||||
<view class="business com" v-if="true">
|
||||
<view class="special_work com">
|
||||
<view class="title">我的店铺</view>
|
||||
<view class="content ">
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/users/supply_procurement/index?type_id=12&isDetail=1&product_type=98&cate_id=${userInfoData.mer_info.category_id}`)">
|
||||
<!-- @click="navigator(`/pages/nongKe/supply_chain/supplier?type_id=12&isDetail=1&product_type=98&cate_id=${userInfoData.mer_info.category_id}`) -->
|
||||
<image class="icon_img" :src="`${prefix}ghcg.png`" mode="aspectFill"></image>
|
||||
<text class="text">供货采购</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator('/pages/users/order_list/indexCopy?status=-1&product_type=98')">
|
||||
<image class="icon_img" :src="`${prefix}jhgl.png`" mode="aspectFill"></image>
|
||||
<text class="text">进货管理</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator(`/pages/admin/stockOut/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}smck.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">扫码出库</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/nongKe/gather/select_warehouse?mer_id=${mer_id}&stype=2`)">
|
||||
<image class="icon_img" :src="`${prefix}rkgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">入库管理</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator(`/pages/users/embody/embody?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}txgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">提现管理</text>
|
||||
</view>
|
||||
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/chat/customer_list/index?type=1&mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}kfjl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">客服记录</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/admin/order_cancellation/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}ddhx.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">订单核销</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/admin/order/index?mer_id=${mer_id}&type_id=${userInfoData.mer_info.type_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}ddgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">订单管理</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator(`/pages/product/list/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}spgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">商品管理</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/product/basicSet?mer_id=${mer_id}`, '商户设置')">
|
||||
<image class="icon_img" :src="`${prefix}shsz.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">商户设置</text>
|
||||
</view>
|
||||
<!-- <view class="examine"
|
||||
@click="navigator(`/pages/users/trading_hall/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" src="@/static/images/diaohuo.png" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">交易大厅</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/commissionedSales/index/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" src="@/static/images/weituo.png" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">委托销售</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator(`/pages/releaseManagement/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" src="@/static/images/fabu.png" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">发布管理</text>
|
||||
</view> -->
|
||||
<!-- <view class="examine" @click="navigator(`/pages/users/user_invoice_Finance/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" src="@/static/images/cwgk.png" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">财务公开</text>
|
||||
</view> -->
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <gatherBusiness :userInfoData="userInfoData" /> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="business com" v-if="userInfoData.mer_info.type_id!=null&&userInfoData.mer_info.type_id === 11">
|
||||
<view class="business com" v-if="true">
|
||||
<view class="special_work com">
|
||||
<view class="title">里海云仓</view>
|
||||
<view class="content ">
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/nongKe/supply_chain/supplier?type_id=12&isDetail=1&product_type=98&cate_id=${userInfoData.mer_info.category_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}ghcg.png`" mode="aspectFill"></image>
|
||||
<text class="text">供货采购</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator('/pages/users/order_list/index?status=-1')">
|
||||
<image class="icon_img" :src="`${prefix}jhgl.png`" mode="aspectFill"></image>
|
||||
<text class="text">进货管理</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator(`/pages/admin/stockOut/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}smck.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">扫码出库</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/nongKe/gather/select_warehouse?mer_id=${mer_id}&stype=2`)">
|
||||
<image class="icon_img" :src="`${prefix}rkgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">入库管理</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator(`/pages/users/embody/embody?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}txgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">提现管理</text>
|
||||
</view>
|
||||
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/chat/customer_list/index?type=1&mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}kfjl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">客服记录</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/admin/order_cancellation/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}ddhx.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">订单核销</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/admin/order/index?mer_id=${mer_id}&type_id=${userInfoData.mer_info.type_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}ddgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">订单管理</text>
|
||||
</view>
|
||||
<view class="examine" @click="navigator(`/pages/product/list/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" :src="`${prefix}spgl.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">商品管理</text>
|
||||
</view>
|
||||
<view class="examine"
|
||||
@click="navigator(`/pages/product/basicSet?mer_id=${mer_id}`, '商户设置')">
|
||||
<image class="icon_img" :src="`${prefix}shsz.png`" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">商户设置</text>
|
||||
</view>
|
||||
<!-- <view class="examine" @click="navigator(`/pages/users/user_invoice_Finance/index?mer_id=${mer_id}`)">
|
||||
<image class="icon_img" src="@/static/images/cwgk.png" mode="aspectFill">
|
||||
</image>
|
||||
<text class="text">财务公开</text>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</block>
|
||||
<!-- <m-tabbar native>
|
||||
<template v-slot:tabbar_index_2>
|
||||
<view class="custom_style">
|
||||
<view class="custom_style_icon"></view>
|
||||
</view>
|
||||
</template>
|
||||
</m-tabbar> -->
|
||||
<view class="" v-if='jurisdiction==false&&isShow==false'>
|
||||
<emptyPage title="暂无信息"></emptyPage>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mTabbar from '@/components/m-tabbar/m-tabbar.vue'
|
||||
import emptyPage from '@/components/emptyPage.vue';
|
||||
import zbpSwiper from '@/components/zbpSwiper'
|
||||
import {
|
||||
mapState,
|
||||
mapGetters
|
||||
} from 'vuex'
|
||||
import {
|
||||
getWorkArticleCount,
|
||||
getSlideAPI
|
||||
} from '@/api/article.js'
|
||||
import {
|
||||
getStoreList,
|
||||
getUserInfo
|
||||
} from '@/api/user.js'
|
||||
import {
|
||||
getGeocoder,
|
||||
microSeachBarCode,
|
||||
microEadtProduct
|
||||
} from '@/api/store.js'
|
||||
import {
|
||||
Toast
|
||||
} from '@/libs/uniApi';
|
||||
import {
|
||||
getDiy
|
||||
} from '@/api/api.js'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
mTabbar,
|
||||
zbpSwiper,
|
||||
emptyPage
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
locationArr: ({}),
|
||||
emptyText: '暂无可用应用',
|
||||
jurisdiction: false, // 是否有权限
|
||||
mer_id: '',
|
||||
userInfoData: {
|
||||
mer_info: {
|
||||
type_id: 0
|
||||
}
|
||||
},
|
||||
prefix: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/11/',
|
||||
isShow: false,
|
||||
bgColor: '',
|
||||
isFshow: false,
|
||||
street:''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo', 'location', 'isLogin'])
|
||||
},
|
||||
created() {},
|
||||
onLoad() {},
|
||||
onShow() {
|
||||
if (this.isLogin) {
|
||||
this.emptyText = '暂无可用应用'
|
||||
this.jurisdiction = false
|
||||
} else {
|
||||
this.emptyText = '请登录'
|
||||
this.jurisdiction = true
|
||||
}
|
||||
this.getUserInfo()
|
||||
this.appLocation()
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.getUserInfo()
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
mounted() {
|
||||
this.appLocation()
|
||||
// #ifdef H5
|
||||
// 监听页面滚动事件
|
||||
window.addEventListener("scroll", this.scrolling);
|
||||
// #endif
|
||||
|
||||
|
||||
},
|
||||
// #ifdef APP-PLUS
|
||||
onPageScroll(e) {
|
||||
// this.scrollTop = e.scrollTop;
|
||||
console.log(e.scrollTop)
|
||||
if (e.scrollTop > 0) {
|
||||
this.isFshow = true
|
||||
} else {
|
||||
this.isFshow = false
|
||||
}
|
||||
|
||||
},
|
||||
// #endif
|
||||
|
||||
methods: {
|
||||
|
||||
|
||||
appLocation() {
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
timeout: '10',
|
||||
success: (res) => {
|
||||
// console.log(res)
|
||||
|
||||
let latitude, longitude;
|
||||
latitude = res.latitude.toString();
|
||||
longitude = res.longitude.toString();
|
||||
getGeocoder({
|
||||
lat: latitude,
|
||||
long: longitude
|
||||
}).then(res => {
|
||||
this.street = res.data.address_component.street
|
||||
Cache.set('ADRESS_LOCATION', this.street)
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err,
|
||||
icon: 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
fail: (err) => {
|
||||
|
||||
uni.showToast({
|
||||
title: "获取定位超时",
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
scrolling() {
|
||||
// 滚动条距文档顶部的距离
|
||||
let scrollTop =
|
||||
window.pageYOffset ||
|
||||
document.documentElement.scrollTop ||
|
||||
document.body.scrollTop;
|
||||
// 滚动条滚动的距离
|
||||
let scrollStep = scrollTop - this.oldScrollTop;
|
||||
console.log("header 滚动距离 ", scrollTop);
|
||||
// 更新——滚动前,滚动条距文档顶部的距离
|
||||
this.oldScrollTop = scrollTop;
|
||||
|
||||
//变量windowHeight是可视区的高度
|
||||
let windowHeight =
|
||||
document.documentElement.clientHeight || document.body.clientHeight;
|
||||
//变量scrollHeight是滚动条的总高度
|
||||
let scrollHeight =
|
||||
document.documentElement.scrollHeight || document.body.scrollHeight;
|
||||
|
||||
//滚动条到底部的条件
|
||||
if (scrollTop + windowHeight == scrollHeight) {
|
||||
//你想做的事情
|
||||
console.log("header 你已经到底部了");
|
||||
}
|
||||
if (scrollStep < 0) {
|
||||
this.isFshow = false
|
||||
console.log("header 滚动条向上滚动了!");
|
||||
} else {
|
||||
this.isFshow = true
|
||||
console.log("header 滚动条向下滚动了!");
|
||||
}
|
||||
// 判断是否到了最顶部
|
||||
if (scrollTop <= 0) {
|
||||
this.isFshow = false
|
||||
console.log("header 到了最顶部")
|
||||
}
|
||||
},
|
||||
|
||||
kkchange(e) {
|
||||
this.bgColor = e
|
||||
},
|
||||
|
||||
navigator(url, t) {
|
||||
// if (this.userInfoData.is_wsxx === 0 && t != '商户设置') return Toast("请完善商户信息");
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
})
|
||||
},
|
||||
getUserInfo: function() {
|
||||
let that = this;
|
||||
getUserInfo().then(res => {
|
||||
that.userInfoData = res.data;
|
||||
// console.log(res.data.service);
|
||||
if (res.data.service == null) {
|
||||
// console.log('123');
|
||||
this.isShow = false
|
||||
} else {
|
||||
this.isShow = true
|
||||
this.mer_id = res.data.service.mer_id
|
||||
}
|
||||
|
||||
if (!res.data.mer_info) {
|
||||
that.$set(this, 'jurisdiction', false);
|
||||
}
|
||||
// console.log(that.userInfoData);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.gather {
|
||||
padding-bottom: 164.91rpx;
|
||||
background: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%);
|
||||
}
|
||||
|
||||
.bg-img {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
/* #ifdef MP || APP-PLUS */
|
||||
z-index: -100;
|
||||
/* #endif */
|
||||
/* #ifdef H5 */
|
||||
z-index: -100;
|
||||
/* #endif */
|
||||
z-index: -100;
|
||||
filter: blur(0);
|
||||
overflow: hidden;
|
||||
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
filter: blur(30rpx);
|
||||
transform: scale(1.5);
|
||||
}
|
||||
}
|
||||
|
||||
.site-box {
|
||||
width: 100%;
|
||||
height: 120rpx;
|
||||
margin-bottom: 26.32rpx;
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
position: fixed;
|
||||
z-index: 999;
|
||||
padding-top: 30rpx;
|
||||
padding-right: 20rpx;
|
||||
|
||||
// 位置
|
||||
.place_wrapper {
|
||||
color: #fff;
|
||||
margin-right: 24.56rpx;
|
||||
font-size: 30rpx;
|
||||
|
||||
.town_name {
|
||||
margin-left: 21rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-size: 35.09rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.top_box {
|
||||
// padding-top: 180rpx;
|
||||
background: linear-gradient(#36A2FF, #fff);
|
||||
}
|
||||
|
||||
.com {
|
||||
margin-left: 50%;
|
||||
transform: translate(-50%);
|
||||
}
|
||||
|
||||
.business {
|
||||
width: 694.74rpx;
|
||||
// margin-bottom: 175rpx;
|
||||
}
|
||||
|
||||
.special_work {
|
||||
// padding: 17.54rpx;
|
||||
width: 694.74rpx;
|
||||
// margin-top: 52.63rpx;
|
||||
padding-top: 32rpx;
|
||||
border-radius: 17.54rpx;
|
||||
// box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.16);
|
||||
|
||||
.title {
|
||||
font-size: 31.58rpx;
|
||||
font-weight: 700;
|
||||
margin-bottom: 38.6rpx;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
align-content: center;
|
||||
flex-wrap: wrap;
|
||||
// justify-content: space-between;
|
||||
|
||||
.examine {
|
||||
margin-bottom: 35rpx;
|
||||
width: 173.68rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
// margin: 0 0 33.33rpx 33.33rpx !important;
|
||||
|
||||
.icon_img {
|
||||
width: 63.16rpx;
|
||||
height: 63.16rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 26.32rpx;
|
||||
margin-top: 21.05rpx;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 29.82rpx;
|
||||
color: #a4a4a4;
|
||||
}
|
||||
}
|
||||
|
||||
.cont_jus {
|
||||
margin-top: 56.14rpx;
|
||||
justify-content: flex-start;
|
||||
|
||||
&:first-child {
|
||||
// margin-right: 33rpx;
|
||||
}
|
||||
|
||||
.examine {
|
||||
margin-right: 48rpx;
|
||||
|
||||
&:first-child {
|
||||
margin-right: 48rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
123
utils/uniMP.js
Normal file
123
utils/uniMP.js
Normal file
@ -0,0 +1,123 @@
|
||||
import { getGXconfig } from "@/api/uniMP.js";
|
||||
const mp = uni.requireNativePlugin('uniMP');
|
||||
|
||||
let appid = ''; // 应用id
|
||||
let wgtFile = ''; // 应用文件地址
|
||||
|
||||
// 比较版本号大小
|
||||
function compareVersions(version1, version2) {
|
||||
const arr1 = version1.split('.').map(Number);
|
||||
const arr2 = version2.split('.').map(Number);
|
||||
for (let i = 0; i < Math.max(arr1.length, arr2.length); i++) {
|
||||
const num1 = i < arr1.length ? arr1[i] : 0;
|
||||
const num2 = i < arr2.length ? arr2[i] : 0;
|
||||
if (num1 > num2) {
|
||||
return 1;
|
||||
} else if (num1 < num2) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 加载小程序
|
||||
const loadMP = async (id) => {
|
||||
appid = id;
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
let info = await getGXconfig();
|
||||
console.log('最新版本', info.data);
|
||||
console.log(mp, uni);
|
||||
// return ;
|
||||
mp.getUniMPVersion(id, (ret) => {
|
||||
console.log('当前版本', ret);
|
||||
if (0!=ret.code||compareVersions(info.data.version, ret.versionInfo.name) == 1) {
|
||||
uni.downloadFile({
|
||||
url: info.data.version_info?.dow_url,
|
||||
success(res) {
|
||||
wgtFile = res.tempFilePath;
|
||||
console.log('下载完成', wgtFile);
|
||||
installMP();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
open()
|
||||
}
|
||||
});
|
||||
};
|
||||
// 小程序版本信息
|
||||
const getVersion = (id) => {
|
||||
appid = id;
|
||||
return new Promise((resolve, reject) => {
|
||||
mp.getUniMPVersion(appid, (ret) => {
|
||||
console.log('供销', ret);
|
||||
});
|
||||
})
|
||||
}
|
||||
// 安装小程序
|
||||
const installMP = () => {
|
||||
mp.getUniMPVersion(appid, (ret) => {
|
||||
console.log('安装:供销', ret);
|
||||
doInstallMP();
|
||||
// if (0 != ret.code) { //获取失败时安装应用
|
||||
// doInstallMP();
|
||||
// } else {
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: 'uni小程序已安装,是否覆盖?',
|
||||
// success: res => {
|
||||
// res.confirm && doInstallMP();
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
console.log('getUniMPVersion: ' + JSON.stringify(ret));
|
||||
});
|
||||
};
|
||||
const doInstallMP = () => {
|
||||
mp.installUniMP({
|
||||
appid: appid,
|
||||
wgtFile: wgtFile
|
||||
}, (r) => {
|
||||
if (0 == r.code) {
|
||||
// uni.showToast({
|
||||
// title: '安装成功'
|
||||
// });
|
||||
console.log('小程序安装成功');
|
||||
open();
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showModal({
|
||||
title: '安装失败',
|
||||
content: JSON.stringify(r),
|
||||
showCancel: false
|
||||
});
|
||||
}
|
||||
console.log('安装供销: ' + JSON.stringify(r));
|
||||
});
|
||||
};
|
||||
|
||||
const open = (id = null) => {
|
||||
mp.openUniMP({
|
||||
appid: id || appid
|
||||
}, (ret) => {
|
||||
uni.hideLoading();
|
||||
if (0 != ret.code) {
|
||||
uni.showModal({
|
||||
title: '启动失败',
|
||||
content: JSON.stringify(ret),
|
||||
showCancel: false
|
||||
});
|
||||
}
|
||||
console.log('openUniMP: ' + JSON.stringify(ret));
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
loadMP,
|
||||
installMP,
|
||||
doInstallMP,
|
||||
getVersion,
|
||||
open
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user