生产 以及 mp完善
This commit is contained in:
parent
552d97ce16
commit
fc9139f417
@ -16,3 +16,12 @@ export function getGXconfig(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",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
|
||||
"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"
|
||||
icon="http://cdn.uviewui.com/uview/empty/permission.png"></u-empty>
|
||||
<view class="business com special_work" v-if="jurisdiction == false">
|
||||
@ -73,7 +73,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<u-picker :defaultIndex="[0,0]" :show="showPicker" ref="uPicker" :columns="columnData" @confirm="confirm"
|
||||
@cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker>
|
||||
<!-- <m-tabbar native>
|
||||
@ -126,7 +126,7 @@
|
||||
components: {
|
||||
mTabbar,
|
||||
zbpSwiper
|
||||
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -149,7 +149,7 @@
|
||||
AllMenuList: [{
|
||||
name: '商户平台',
|
||||
icon: '/static/applet/shop_app.png',
|
||||
data: '/pages/moreProject/moreProject',
|
||||
data: "__UNI__1EE148C",
|
||||
type: 2,
|
||||
},
|
||||
{
|
||||
@ -158,21 +158,21 @@
|
||||
data: '__UNI__B5B1EDD',
|
||||
type: 1,
|
||||
},
|
||||
{
|
||||
name: '农业咨询',
|
||||
icon: '/static/applet/ny.png',
|
||||
data: {
|
||||
id: '__UNI__9620511',
|
||||
url: '/static/wgt/__UNI__9620511.wgt',
|
||||
},
|
||||
type: 1,
|
||||
}
|
||||
{
|
||||
name: '农业咨询',
|
||||
icon: '/static/applet/ny.png',
|
||||
data: {
|
||||
id: '__UNI__9620511',
|
||||
url: '/static/wgt/__UNI__9620511.wgt',
|
||||
},
|
||||
type: 1,
|
||||
}
|
||||
],
|
||||
nowMenuList: [],
|
||||
street: '',
|
||||
showPicker: false,
|
||||
columnData: [],
|
||||
|
||||
|
||||
isFshow: false,
|
||||
backColor: 'rgba(252, 252, 252, 0)'
|
||||
};
|
||||
@ -297,7 +297,7 @@
|
||||
this.getUniMp(data);
|
||||
break;
|
||||
case 2:
|
||||
this.navigator(data);
|
||||
this.getUniMp1(data);
|
||||
break;
|
||||
}
|
||||
},
|
||||
@ -322,11 +322,43 @@
|
||||
},
|
||||
getUniMp(data) {
|
||||
// #ifdef APP-PLUS
|
||||
console.log(data, typeof data == 'string');
|
||||
if(typeof data == 'string') uniMP.loadMP(data);
|
||||
else uniMP.loadMPurl(data);
|
||||
// uniMP.loadMPurl(data);
|
||||
// uniMP.open(data.id);
|
||||
console.log(data, typeof data == 'string');
|
||||
|
||||
if (typeof data == 'string') uniMP.loadMP(data);
|
||||
else uniMP.loadMPurl(data);
|
||||
// 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;
|
||||
// #endif
|
||||
uni.showToast({
|
||||
@ -467,7 +499,8 @@
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
.site-box1 {
|
||||
|
||||
.site-box1 {
|
||||
width: 706rpx;
|
||||
/* #ifdef MP || APP-PLUS */
|
||||
height: 160rpx;
|
||||
@ -479,25 +512,27 @@
|
||||
position: absolute;
|
||||
top: 45rpx;
|
||||
left: 20rpx;
|
||||
|
||||
|
||||
z-index: 999;
|
||||
|
||||
// 位置
|
||||
.place_wrapper {
|
||||
color: #fff;
|
||||
margin-right: 0rpx;
|
||||
|
||||
|
||||
font-size: 30rpx;
|
||||
|
||||
|
||||
.town_name {
|
||||
margin-left: 21rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.iconfont {
|
||||
font-size: 35.09rpx;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.site-box {
|
||||
width: 100%;
|
||||
/* #ifdef MP || APP-PLUS */
|
||||
|
@ -615,7 +615,7 @@
|
||||
created() {},
|
||||
onLoad() {
|
||||
this.Fheight = uni.getSystemInfoSync().windowHeight + 'px';
|
||||
console.log(this.Fheight)
|
||||
|
||||
},
|
||||
onShow() {
|
||||
if (this.isLogin) {
|
||||
@ -864,8 +864,7 @@
|
||||
navigator(url, t) {
|
||||
|
||||
if (this.userInfoData.mer_info.mer_settlement_agree_status == 0) {
|
||||
// console.log(this.codenote)
|
||||
|
||||
|
||||
|
||||
if (this.codenote.length == 0) {
|
||||
this.isFshow = true
|
||||
@ -880,7 +879,6 @@
|
||||
this.countDown()
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
uni.navigateTo({
|
||||
|
@ -47,12 +47,13 @@
|
||||
<swiper-item :class="{ active: 1 == swiperCur }">
|
||||
<view class="slide-navigator">
|
||||
<!-- 隐藏暂时不需要 -->
|
||||
<navigator class="item" :url="`/pages/product/addGoods/freightTemplate?mer_id=${mer_id}`"
|
||||
hover-class='none'>
|
||||
<image mode='widthFix' class="image" src="../static/images/product_freight.png">
|
||||
</image>
|
||||
<text class="text">运费模板</text>
|
||||
</navigator>
|
||||
<navigator class="item"
|
||||
:url="`/pages/product/addGoods/freightTemplate?mer_id=${mer_id}`"
|
||||
hover-class='none'>
|
||||
<image mode='widthFix' class="image" src="../static/images/product_freight.png">
|
||||
</image>
|
||||
<text class="text">运费模板</text>
|
||||
</navigator>
|
||||
<navigator class="item"
|
||||
:url="`/pages/product/addGoods/mulSpecification?mer_id=${mer_id}`"
|
||||
hover-class='none'>
|
||||
@ -169,7 +170,7 @@
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="shuru" v-if="this.on_line == 1">
|
||||
数量: <input type="number" v-model="data.number" placeholder="请输入">
|
||||
</view>
|
||||
@ -245,7 +246,8 @@
|
||||
on_line: '',
|
||||
isshow: false,
|
||||
num: -1,
|
||||
ll: 0
|
||||
ll: 0,
|
||||
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
@ -262,10 +264,10 @@
|
||||
},
|
||||
onReachBottom() {
|
||||
// console.log(this.status, '222222222')
|
||||
if (this.status == 'nomore') return;
|
||||
if (this.status == 'nomore') return;
|
||||
this.status = 'loading';
|
||||
this.where.page = ++this.where.page;
|
||||
this.getList(this.mer_id, true);
|
||||
this.getList(this.mer_id, false);
|
||||
},
|
||||
|
||||
methods: {
|
||||
@ -342,7 +344,17 @@
|
||||
this.checkboxList1 = item.attrValue
|
||||
this.data.product_id = item.attrValue[0].product_id
|
||||
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 {
|
||||
postImport(this.mer_id, this.data).then(res => {
|
||||
this.data.unique = ''
|
||||
this.data.product_id=''
|
||||
this.data.number=1
|
||||
this.data.product_id = ''
|
||||
this.data.number = 1
|
||||
this.loading = false
|
||||
this.loaded = false
|
||||
this.getList(this.mer_id, true);
|
||||
@ -391,15 +403,15 @@
|
||||
title: res.message
|
||||
})
|
||||
this.data.unique = ''
|
||||
this.data.product_id=''
|
||||
this.data.number=1
|
||||
|
||||
this.data.product_id = ''
|
||||
this.data.number = 1
|
||||
|
||||
|
||||
}).catch(err => {
|
||||
this.show = false
|
||||
this.data.unique = ''
|
||||
this.data.product_id=''
|
||||
this.data.number=1
|
||||
this.data.product_id = ''
|
||||
this.data.number = 1
|
||||
this.$util.Tips({
|
||||
title: '请选择规格后再次进行入库'
|
||||
})
|
||||
@ -414,12 +426,15 @@
|
||||
title: '请选择规格'
|
||||
})
|
||||
} else {
|
||||
|
||||
navigateTo(1, '/pages/users/online_warehousing/index', {
|
||||
mer_id: this.mer_id,
|
||||
product_id: this.data.product_id,
|
||||
unique: this.data.unique,
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -474,8 +489,8 @@
|
||||
res => {
|
||||
that.loading = false;
|
||||
that.loaded = res.data.list.length < that.where.limit;
|
||||
// that.productList.push.apply(that.productList, res.data.list);
|
||||
that.productList.push(...res.data.list);
|
||||
that.productList.push.apply(that.productList, res.data.list);
|
||||
|
||||
that.where.page = that.where.page + 1;
|
||||
|
||||
},
|
||||
|
@ -1,5 +1,12 @@
|
||||
<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'>
|
||||
<view class='merchantsSettled'>
|
||||
<view class="merchantBgCount">
|
||||
@ -192,11 +199,12 @@
|
||||
</view>
|
||||
</view>
|
||||
<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> -->
|
||||
<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">
|
||||
<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>
|
||||
|
||||
<div class="title">{{detail.title}}</div>
|
||||
@ -228,7 +236,7 @@
|
||||
ref="verify">
|
||||
</Verify>
|
||||
</view>
|
||||
<view class="settledSuccessMain" v-else :style="viewColor">
|
||||
<view class="settledSuccessMain " v-else :style="viewColor" >
|
||||
<view class="settledSuccessful">
|
||||
<image class="image" src="../static/images/settledSuccessful.svg" alt="">
|
||||
<view class="title">恭喜,您的资料提交成功!</view>
|
||||
@ -238,6 +246,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
@ -385,10 +394,16 @@
|
||||
this.shoplist()
|
||||
},
|
||||
onShow() {
|
||||
|
||||
|
||||
},
|
||||
onReady() {},
|
||||
methods: {
|
||||
//退出
|
||||
logout(){
|
||||
uni.switchTab({
|
||||
url:'/pages/user/index'
|
||||
})
|
||||
},
|
||||
//关闭弹窗
|
||||
recuo() {
|
||||
if (this.num > 0) {
|
||||
@ -576,13 +591,18 @@
|
||||
street_code: this.street_id
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.company =''
|
||||
this.organization_code =''
|
||||
this.$util.Tips({
|
||||
title: res.msg
|
||||
});
|
||||
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 => {
|
||||
console.log(res)
|
||||
})
|
||||
@ -929,7 +949,20 @@
|
||||
background-color: var(--view-theme) !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 {
|
||||
color: #B2B2B2;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import {
|
||||
getGXconfig
|
||||
getGXconfig,
|
||||
miniapp
|
||||
} from "@/api/uniMP.js";
|
||||
import {
|
||||
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加载小程序
|
||||
const loadMPurl = async (e) => {
|
||||
appid = e.id;
|
||||
@ -169,6 +230,7 @@ const open = (id = null) => {
|
||||
export default {
|
||||
loadMP,
|
||||
loadMPurl,
|
||||
loadMPx,
|
||||
installMP,
|
||||
doInstallMP,
|
||||
getVersion,
|
||||
|
Loading…
x
Reference in New Issue
Block a user