生产 以及 mp完善
This commit is contained in:
parent
552d97ce16
commit
fc9139f417
@ -16,3 +16,12 @@ export function getGXconfig(data) {
|
|||||||
return request.get("global/config", data);
|
return request.get("global/config", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取商城小程序信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function miniapp(data) {
|
||||||
|
return request.get("miniapp/version?version=1", data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -990,6 +990,8 @@
|
|||||||
{
|
{
|
||||||
"path": "settled/index",
|
"path": "settled/index",
|
||||||
"style": {
|
"style": {
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
|
||||||
"navigationBarTitleText": "商家入驻"
|
"navigationBarTitleText": "商家入驻"
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<zbpSwiper :isSelectPlace="true" :location_Arr="locationArr" :town="street" ></zbpSwiper>
|
<zbpSwiper :isSelectPlace="true" :location_Arr="locationArr" :town="street"></zbpSwiper>
|
||||||
<u-empty :show="jurisdiction" mode="permission" :text="emptyText"
|
<u-empty :show="jurisdiction" mode="permission" :text="emptyText"
|
||||||
icon="http://cdn.uviewui.com/uview/empty/permission.png"></u-empty>
|
icon="http://cdn.uviewui.com/uview/empty/permission.png"></u-empty>
|
||||||
<view class="business com special_work" v-if="jurisdiction == false">
|
<view class="business com special_work" v-if="jurisdiction == false">
|
||||||
@ -73,7 +73,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<u-picker :defaultIndex="[0,0]" :show="showPicker" ref="uPicker" :columns="columnData" @confirm="confirm"
|
<u-picker :defaultIndex="[0,0]" :show="showPicker" ref="uPicker" :columns="columnData" @confirm="confirm"
|
||||||
@cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker>
|
@cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker>
|
||||||
<!-- <m-tabbar native>
|
<!-- <m-tabbar native>
|
||||||
@ -126,7 +126,7 @@
|
|||||||
components: {
|
components: {
|
||||||
mTabbar,
|
mTabbar,
|
||||||
zbpSwiper
|
zbpSwiper
|
||||||
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -149,7 +149,7 @@
|
|||||||
AllMenuList: [{
|
AllMenuList: [{
|
||||||
name: '商户平台',
|
name: '商户平台',
|
||||||
icon: '/static/applet/shop_app.png',
|
icon: '/static/applet/shop_app.png',
|
||||||
data: '/pages/moreProject/moreProject',
|
data: "__UNI__1EE148C",
|
||||||
type: 2,
|
type: 2,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -158,21 +158,21 @@
|
|||||||
data: '__UNI__B5B1EDD',
|
data: '__UNI__B5B1EDD',
|
||||||
type: 1,
|
type: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '农业咨询',
|
name: '农业咨询',
|
||||||
icon: '/static/applet/ny.png',
|
icon: '/static/applet/ny.png',
|
||||||
data: {
|
data: {
|
||||||
id: '__UNI__9620511',
|
id: '__UNI__9620511',
|
||||||
url: '/static/wgt/__UNI__9620511.wgt',
|
url: '/static/wgt/__UNI__9620511.wgt',
|
||||||
},
|
},
|
||||||
type: 1,
|
type: 1,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
nowMenuList: [],
|
nowMenuList: [],
|
||||||
street: '',
|
street: '',
|
||||||
showPicker: false,
|
showPicker: false,
|
||||||
columnData: [],
|
columnData: [],
|
||||||
|
|
||||||
isFshow: false,
|
isFshow: false,
|
||||||
backColor: 'rgba(252, 252, 252, 0)'
|
backColor: 'rgba(252, 252, 252, 0)'
|
||||||
};
|
};
|
||||||
@ -297,7 +297,7 @@
|
|||||||
this.getUniMp(data);
|
this.getUniMp(data);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
this.navigator(data);
|
this.getUniMp1(data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -322,11 +322,43 @@
|
|||||||
},
|
},
|
||||||
getUniMp(data) {
|
getUniMp(data) {
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
console.log(data, typeof data == 'string');
|
console.log(data, typeof data == 'string');
|
||||||
if(typeof data == 'string') uniMP.loadMP(data);
|
|
||||||
else uniMP.loadMPurl(data);
|
if (typeof data == 'string') uniMP.loadMP(data);
|
||||||
// uniMP.loadMPurl(data);
|
else uniMP.loadMPurl(data);
|
||||||
// uniMP.open(data.id);
|
// uniMP.loadMPurl(data);
|
||||||
|
// uniMP.open(data.id);
|
||||||
|
return;
|
||||||
|
// #endif
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: 'H5不支持打开小程序'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeHandler(e) {
|
||||||
|
const {
|
||||||
|
columnIndex,
|
||||||
|
value,
|
||||||
|
values,
|
||||||
|
index,
|
||||||
|
picker = this.$refs.uPicker
|
||||||
|
} = e;
|
||||||
|
if (columnIndex === 0) {
|
||||||
|
getStreet({
|
||||||
|
area_code: value[0]['code']
|
||||||
|
}).then(res => {
|
||||||
|
this.$refs.uPicker.setColumnValues(1, res.data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getUniMp1(data) {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
console.log(data, typeof data == 'string');
|
||||||
|
|
||||||
|
if (typeof data == 'string') uniMP.loadMPx(data);
|
||||||
|
else uniMP.loadMPurl(data);
|
||||||
|
// uniMP.loadMPurl(data);
|
||||||
|
// uniMP.open(data.id);
|
||||||
return;
|
return;
|
||||||
// #endif
|
// #endif
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@ -467,7 +499,8 @@
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.site-box1 {
|
|
||||||
|
.site-box1 {
|
||||||
width: 706rpx;
|
width: 706rpx;
|
||||||
/* #ifdef MP || APP-PLUS */
|
/* #ifdef MP || APP-PLUS */
|
||||||
height: 160rpx;
|
height: 160rpx;
|
||||||
@ -479,25 +512,27 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 45rpx;
|
top: 45rpx;
|
||||||
left: 20rpx;
|
left: 20rpx;
|
||||||
|
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
|
|
||||||
// 位置
|
// 位置
|
||||||
.place_wrapper {
|
.place_wrapper {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
margin-right: 0rpx;
|
margin-right: 0rpx;
|
||||||
|
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
|
|
||||||
.town_name {
|
.town_name {
|
||||||
margin-left: 21rpx;
|
margin-left: 21rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
font-size: 35.09rpx;
|
font-size: 35.09rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.site-box {
|
.site-box {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
/* #ifdef MP || APP-PLUS */
|
/* #ifdef MP || APP-PLUS */
|
||||||
|
@ -615,7 +615,7 @@
|
|||||||
created() {},
|
created() {},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.Fheight = uni.getSystemInfoSync().windowHeight + 'px';
|
this.Fheight = uni.getSystemInfoSync().windowHeight + 'px';
|
||||||
console.log(this.Fheight)
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
if (this.isLogin) {
|
if (this.isLogin) {
|
||||||
@ -864,8 +864,7 @@
|
|||||||
navigator(url, t) {
|
navigator(url, t) {
|
||||||
|
|
||||||
if (this.userInfoData.mer_info.mer_settlement_agree_status == 0) {
|
if (this.userInfoData.mer_info.mer_settlement_agree_status == 0) {
|
||||||
// console.log(this.codenote)
|
|
||||||
|
|
||||||
|
|
||||||
if (this.codenote.length == 0) {
|
if (this.codenote.length == 0) {
|
||||||
this.isFshow = true
|
this.isFshow = true
|
||||||
@ -880,7 +879,6 @@
|
|||||||
this.countDown()
|
this.countDown()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
@ -47,12 +47,13 @@
|
|||||||
<swiper-item :class="{ active: 1 == swiperCur }">
|
<swiper-item :class="{ active: 1 == swiperCur }">
|
||||||
<view class="slide-navigator">
|
<view class="slide-navigator">
|
||||||
<!-- 隐藏暂时不需要 -->
|
<!-- 隐藏暂时不需要 -->
|
||||||
<navigator class="item" :url="`/pages/product/addGoods/freightTemplate?mer_id=${mer_id}`"
|
<navigator class="item"
|
||||||
hover-class='none'>
|
:url="`/pages/product/addGoods/freightTemplate?mer_id=${mer_id}`"
|
||||||
<image mode='widthFix' class="image" src="../static/images/product_freight.png">
|
hover-class='none'>
|
||||||
</image>
|
<image mode='widthFix' class="image" src="../static/images/product_freight.png">
|
||||||
<text class="text">运费模板</text>
|
</image>
|
||||||
</navigator>
|
<text class="text">运费模板</text>
|
||||||
|
</navigator>
|
||||||
<navigator class="item"
|
<navigator class="item"
|
||||||
:url="`/pages/product/addGoods/mulSpecification?mer_id=${mer_id}`"
|
:url="`/pages/product/addGoods/mulSpecification?mer_id=${mer_id}`"
|
||||||
hover-class='none'>
|
hover-class='none'>
|
||||||
@ -169,7 +170,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="shuru" v-if="this.on_line == 1">
|
<view class="shuru" v-if="this.on_line == 1">
|
||||||
数量: <input type="number" v-model="data.number" placeholder="请输入">
|
数量: <input type="number" v-model="data.number" placeholder="请输入">
|
||||||
</view>
|
</view>
|
||||||
@ -245,7 +246,8 @@
|
|||||||
on_line: '',
|
on_line: '',
|
||||||
isshow: false,
|
isshow: false,
|
||||||
num: -1,
|
num: -1,
|
||||||
ll: 0
|
ll: 0,
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
@ -262,10 +264,10 @@
|
|||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
// console.log(this.status, '222222222')
|
// console.log(this.status, '222222222')
|
||||||
if (this.status == 'nomore') return;
|
if (this.status == 'nomore') return;
|
||||||
this.status = 'loading';
|
this.status = 'loading';
|
||||||
this.where.page = ++this.where.page;
|
this.where.page = ++this.where.page;
|
||||||
this.getList(this.mer_id, true);
|
this.getList(this.mer_id, false);
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@ -342,7 +344,17 @@
|
|||||||
this.checkboxList1 = item.attrValue
|
this.checkboxList1 = item.attrValue
|
||||||
this.data.product_id = item.attrValue[0].product_id
|
this.data.product_id = item.attrValue[0].product_id
|
||||||
this.data.unique = item.attrValue[0].unique
|
this.data.unique = item.attrValue[0].unique
|
||||||
this.show = true
|
if (item.spec_type == 1) {
|
||||||
|
this.show = true
|
||||||
|
} else {
|
||||||
|
navigateTo(1, '/pages/users/online_warehousing/index', {
|
||||||
|
mer_id: this.mer_id,
|
||||||
|
product_id: this.data.product_id,
|
||||||
|
unique: this.data.unique,
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
//线下
|
//线下
|
||||||
@ -381,8 +393,8 @@
|
|||||||
} else {
|
} else {
|
||||||
postImport(this.mer_id, this.data).then(res => {
|
postImport(this.mer_id, this.data).then(res => {
|
||||||
this.data.unique = ''
|
this.data.unique = ''
|
||||||
this.data.product_id=''
|
this.data.product_id = ''
|
||||||
this.data.number=1
|
this.data.number = 1
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.loaded = false
|
this.loaded = false
|
||||||
this.getList(this.mer_id, true);
|
this.getList(this.mer_id, true);
|
||||||
@ -391,15 +403,15 @@
|
|||||||
title: res.message
|
title: res.message
|
||||||
})
|
})
|
||||||
this.data.unique = ''
|
this.data.unique = ''
|
||||||
this.data.product_id=''
|
this.data.product_id = ''
|
||||||
this.data.number=1
|
this.data.number = 1
|
||||||
|
|
||||||
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.show = false
|
this.show = false
|
||||||
this.data.unique = ''
|
this.data.unique = ''
|
||||||
this.data.product_id=''
|
this.data.product_id = ''
|
||||||
this.data.number=1
|
this.data.number = 1
|
||||||
this.$util.Tips({
|
this.$util.Tips({
|
||||||
title: '请选择规格后再次进行入库'
|
title: '请选择规格后再次进行入库'
|
||||||
})
|
})
|
||||||
@ -414,12 +426,15 @@
|
|||||||
title: '请选择规格'
|
title: '请选择规格'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
navigateTo(1, '/pages/users/online_warehousing/index', {
|
navigateTo(1, '/pages/users/online_warehousing/index', {
|
||||||
mer_id: this.mer_id,
|
mer_id: this.mer_id,
|
||||||
product_id: this.data.product_id,
|
product_id: this.data.product_id,
|
||||||
unique: this.data.unique,
|
unique: this.data.unique,
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -474,8 +489,8 @@
|
|||||||
res => {
|
res => {
|
||||||
that.loading = false;
|
that.loading = false;
|
||||||
that.loaded = res.data.list.length < that.where.limit;
|
that.loaded = res.data.list.length < that.where.limit;
|
||||||
// that.productList.push.apply(that.productList, res.data.list);
|
that.productList.push.apply(that.productList, res.data.list);
|
||||||
that.productList.push(...res.data.list);
|
|
||||||
that.where.page = that.where.page + 1;
|
that.where.page = that.where.page + 1;
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<view v-if="!successful" :style="viewColor">
|
<view class="" style="padding-top:var(--status-bar-height)">
|
||||||
|
<view class="conten-top">
|
||||||
|
<view class="" style="position: absolute;left: 30rpx;" @click="logout"><i class="iconfont icon-xiangzuo" style="font-size: 40rpx;text-align: left;"></i></view>
|
||||||
|
<view class="" style="font-size: 30rpx;">
|
||||||
|
商家入驻
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="!successful" :style="viewColor" style="margin-top: 50rpx;">
|
||||||
<form report-submit='true'>
|
<form report-submit='true'>
|
||||||
<view class='merchantsSettled'>
|
<view class='merchantsSettled'>
|
||||||
<view class="merchantBgCount">
|
<view class="merchantBgCount">
|
||||||
@ -192,11 +199,12 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="settlementAgreement" v-if="isshow">
|
<view class="settlementAgreement" v-if="isshow">
|
||||||
<view class="setAgCount" style="width: 100%;height: 100%;">
|
<view class="setAgCount" style="width: 100%;height: 100%;padding-top: 180rpx;">
|
||||||
<!-- <i class="icon iconfont icon-cha" @click="recuo"></i> -->
|
<!-- <i class="icon iconfont icon-cha" @click="recuo"></i> -->
|
||||||
<view class="" style="width: 60rpx;height: 60rpx; position: absolute;right: 30rpx; top:20rpx"
|
<view class="" style="width: 60rpx;height: 60rpx; position: absolute;left: 30rpx; top:90rpx"
|
||||||
@click="recuo">
|
@click="recuo">
|
||||||
<image src="@/static/images/close.png" mode="aspectFit" style="width: 60rpx;height: 60rpx;"></image>
|
<i class="iconfont icon-xiangzuo" style="width: 60rpx;height: 60rpx;font-size: 40rpx;"></i>
|
||||||
|
<!-- <image src="@/static/images/close.png" mode="aspectFit" style="width: 60rpx;height: 60rpx;"></image> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<div class="title">{{detail.title}}</div>
|
<div class="title">{{detail.title}}</div>
|
||||||
@ -228,7 +236,7 @@
|
|||||||
ref="verify">
|
ref="verify">
|
||||||
</Verify>
|
</Verify>
|
||||||
</view>
|
</view>
|
||||||
<view class="settledSuccessMain" v-else :style="viewColor">
|
<view class="settledSuccessMain " v-else :style="viewColor" >
|
||||||
<view class="settledSuccessful">
|
<view class="settledSuccessful">
|
||||||
<image class="image" src="../static/images/settledSuccessful.svg" alt="">
|
<image class="image" src="../static/images/settledSuccessful.svg" alt="">
|
||||||
<view class="title">恭喜,您的资料提交成功!</view>
|
<view class="title">恭喜,您的资料提交成功!</view>
|
||||||
@ -238,6 +246,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -385,10 +394,16 @@
|
|||||||
this.shoplist()
|
this.shoplist()
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
|
||||||
},
|
},
|
||||||
onReady() {},
|
onReady() {},
|
||||||
methods: {
|
methods: {
|
||||||
|
//退出
|
||||||
|
logout(){
|
||||||
|
uni.switchTab({
|
||||||
|
url:'/pages/user/index'
|
||||||
|
})
|
||||||
|
},
|
||||||
//关闭弹窗
|
//关闭弹窗
|
||||||
recuo() {
|
recuo() {
|
||||||
if (this.num > 0) {
|
if (this.num > 0) {
|
||||||
@ -576,13 +591,18 @@
|
|||||||
street_code: this.street_id
|
street_code: this.street_id
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
|
this.company =''
|
||||||
|
this.organization_code =''
|
||||||
this.$util.Tips({
|
this.$util.Tips({
|
||||||
title: res.msg
|
title: res.msg
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
|
}else{
|
||||||
|
this.company = res.data.title
|
||||||
|
this.organization_code = res.data.organization_code
|
||||||
}
|
}
|
||||||
this.company = res.data.title
|
|
||||||
this.organization_code = res.data.organization_code
|
|
||||||
}).catch(res => {
|
}).catch(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
})
|
})
|
||||||
@ -929,7 +949,20 @@
|
|||||||
background-color: var(--view-theme) !important;
|
background-color: var(--view-theme) !important;
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.conten-top{
|
||||||
|
width: 100%;
|
||||||
|
// height: 120rpx;
|
||||||
|
padding-top:var(--status-bar-height);
|
||||||
|
// line-height:230rpx;
|
||||||
|
padding-bottom: 30rpx;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #fff;
|
||||||
|
position: absolute;
|
||||||
|
top:0;
|
||||||
|
position: fixed;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
.uni-input-placeholder {
|
.uni-input-placeholder {
|
||||||
color: #B2B2B2;
|
color: #B2B2B2;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
getGXconfig
|
getGXconfig,
|
||||||
|
miniapp
|
||||||
} from "@/api/uniMP.js";
|
} from "@/api/uniMP.js";
|
||||||
import {
|
import {
|
||||||
HTTP_REQUEST_URL
|
HTTP_REQUEST_URL
|
||||||
@ -86,6 +87,66 @@ const loadMP = async (id) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//加载商城小程序
|
||||||
|
const loadMPx = async (id) => {
|
||||||
|
appid = id;
|
||||||
|
let info = await miniapp();
|
||||||
|
console.log('最新版本', info.data);
|
||||||
|
console.log(mp, uni);
|
||||||
|
// return ;
|
||||||
|
uni.showLoading({
|
||||||
|
title: '初始化中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
mp.getUniMPVersion(id, (ret) => {
|
||||||
|
console.log('当前版本', ret);
|
||||||
|
let flag;
|
||||||
|
if (HTTP_REQUEST_URL == 'https://shop.lihaink.cn') {
|
||||||
|
flag = false
|
||||||
|
} else {
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
if (0 != ret.code || compareVersions(info.data.appInfo.version, ret.versionInfo.name) == 1 || flag ==
|
||||||
|
true) {
|
||||||
|
let count = 0;
|
||||||
|
timer = setInterval(() => {
|
||||||
|
if (count < 100) uni.showLoading({
|
||||||
|
title: `初始化中... ${count}%`,
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
else uni.showLoading({
|
||||||
|
title: '初始化中...100%',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
}, 600)
|
||||||
|
|
||||||
|
let downloadTask = uni.downloadFile({
|
||||||
|
url: info.data.appInfo.dow_url,
|
||||||
|
success(res) {
|
||||||
|
wgtFile = res.tempFilePath;
|
||||||
|
console.log('初始化完成', wgtFile);
|
||||||
|
installMP();
|
||||||
|
},
|
||||||
|
fail(res) {
|
||||||
|
clearInterval(timer);
|
||||||
|
timer = null;
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
downloadTask.onProgressUpdate((res) => {
|
||||||
|
// console.log('初始化进度' + res.progress);
|
||||||
|
if (res.progress > count) count += 10;
|
||||||
|
if (count >= 90) {
|
||||||
|
clearInterval(timer);
|
||||||
|
timer = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
open()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 按URL加载小程序
|
// 按URL加载小程序
|
||||||
const loadMPurl = async (e) => {
|
const loadMPurl = async (e) => {
|
||||||
appid = e.id;
|
appid = e.id;
|
||||||
@ -169,6 +230,7 @@ const open = (id = null) => {
|
|||||||
export default {
|
export default {
|
||||||
loadMP,
|
loadMP,
|
||||||
loadMPurl,
|
loadMPurl,
|
||||||
|
loadMPx,
|
||||||
installMP,
|
installMP,
|
||||||
doInstallMP,
|
doInstallMP,
|
||||||
getVersion,
|
getVersion,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user