Commit a7457a32 authored by home's avatar home

zxf

parents 744429dd f0ee7803
......@@ -69,56 +69,80 @@
}
})
},
async getIosLocation(type){
async getIosLocation(type,pages){
let that=this;
if(pages!='index'){
uni.showLoading({
title:'请稍后...'
})
}
let result = permision.judgeIosPermission('location'); //是否授权
if(result){
var cllocationManger = plus.ios.import("CLLocationManager");
var status = cllocationManger.authorizationStatus();
var status = cllocationManger.authorizationStatus();
console.log("status:" + status); //4 使用期间 3前后台都执行 0下次询问 2拒绝授权
if (status == 3 || status==0) {
if(status==0){
uni.getLocation({
type: 'gcj02',
success:(res)=> {
that.$store.commit('horseLng',res.longitude)
that.$store.commit('horseLat',res.latitude)
that.getIosLocation(2,'');
}
});
}else if(status==2||status==4){
uni.hideLoading();
uni.showModal({
title:'温馨提示',
content:'需要您的同意,点击“始终”,打开位置后台运行权限',
success:(res)=>{
if(res.confirm){
permision.gotoAppPermissionSetting(); //打开当前设置
}
}
})
}else if(status==3){
uni.setStorageSync('dwstatus',status);
if(pages!='index'){
that.$api.msg('开启成功');
}
if (that.$store.state.Timer == '') {
that.$store.commit('Timer',setInterval(()=>{
uni.hideLoading();
uni.getLocation({
type: 'gcj02',
success:(res)=> {
that.$store.commit('horseLng',res.longitude)
that.$store.commit('horseLat',res.latitude)
that.getnewsRemind(type);
}
});
},5000));
}else{
clearInterval(that.$store.state.Timer);
that.$store.commit('Timer','');
that.$store.commit('Timer',setInterval(()=>{
uni.hideLoading();
uni.getLocation({
type: 'gcj02',
success:(res)=> {
that.$store.commit('horseLng',res.longitude)
that.$store.commit('horseLat',res.latitude)
that.getnewsRemind(type);
}
});
},5000));
}
} else {
uni.showModal({
title:'提示:需要获取后台运行权限',
content:'点击“始终”,打开后台运行权限?',
success:(res)=>{
if(res.confirm){
permision.gotoAppPermissionSetting(); //打开当前设置
}
}
})
}
}
plus.ios.deleteObject(cllocationManger);
}else{
uni.hideLoading();
uni.showModal({
title:'提示:需要获取您的位置信息',
content:'是否进入设置打开位置权限?',
title:'温馨提示',
content:'定位权限没有开启,是否去开启',
success:(res)=>{
if(res.confirm){
permision.gotoAppPermissionSetting(); //打开当前设置
......
......@@ -34,7 +34,9 @@
<text style="color: #FF6900;" ></text>
</view>
<view class="btnbox flex flex1 jus-e">
<view class="btnbox flex flex1 jus-e">
<view v-if="platform!='ios'?false:is_closed==1?false:true" @tap.stop="locationDetailed(dataorder.lat,dataorder.lng)" class="btns1">查看导航</view>
<block v-for="(action,index) in dataorder.order_operation" :key="index">
<view :class="action.class_name" :data-orderid='dataorder.order_id' @tap.stop="operation" :data-action='action.way' :data-is_ld='dataorder.buytype'>{{action.name}}</view>
</block>
......@@ -49,11 +51,12 @@
props:["dataorder","tabindex","index","status"],
data() {
return {
platform:uni.getSystemInfoSync().platform,
is_closed:1
};
},
mounted() {
console.log('啊啊啊啊')
this.is_closed=this.$store.state.is_closed;
},
updated (){
console.log('玩了')
......@@ -68,7 +71,12 @@
return this.$store.state.staticUrl;
}
},
methods:{
methods:{
locationDetailed(lat,lng){
uni.navigateTo({
url:`/pages/locationDetailed/locationDetailed?userlng=${lng}&userlat=${lat}`
})
},
/**
* 订单操作
*
......@@ -78,7 +86,6 @@
let order_id = event.currentTarget.dataset.orderid;
let index=this.index;
uni.setStorageSync('obj',{order_id,index});
console.log(order_id,'aaa')
switch (action) {
case 'immediatelyOrder': //立即接单 OK
this.immediatelyOrderfun(order_id, action,index);
......
......@@ -161,15 +161,21 @@
checkVersionClick() {
//直接不直接 苹果不做更新
if(uni.getSystemInfoSync().platform == 'ios'){
console.log('zheli')
uni.request({
url: config.SiteBaseUrl+"user/appVersions",
data: {
version: '',
name: '' ,//没啥用
user_token:this.$store.state.token,
},
success: (result) => {
this.$store.commit('is_closed',result.data.is_closed)
}
});
return false;
}
// uni.showToast({
// title:"更新检测~",
// icon:"none"
// })
//this.isshowloading = false;
// 检测升级
plus.runtime.getProperty(plus.runtime.appid, (widgetInfo) => {
......@@ -191,7 +197,6 @@
success: (result) => {
let appVersion = widgetInfo.versionCode;//当前版本
let nesVersion = result.data.data.version;//最新版本
if (nesVersion > appVersion) {
if (result.data.data.pkgurl != '' && result.data.data.downloadurl == '') {
this.type="pkg";
......@@ -210,7 +215,6 @@
}
}else{
console.info("已是最新版本哦~~");
if(this.isshowmsg){
this.$api.msg("已是最新版本~");
}
......
This diff is collapsed.
......@@ -2,9 +2,8 @@
"name" : "鹿马商家助手",
"appid" : "__UNI__1EA80F1", //这个是 web
"description" : "商家",
"versionName" : "1.107",
"versionCode" : 1107,
"versionName" : "1.109",
"versionCode" : 1109,
"transformPx" : false,
"compatible" : {
"ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
......@@ -71,11 +70,11 @@
"NSPhotoLibraryUsageDescription" : "需要获得的允许,才能在上传商城产品时选择图片",
"NSPhotoLibraryAddUsageDescription" : "需要获得的允许,才能在生成店铺二维码后将海报保存到相册",
"NSCameraUsageDescription" : "需要获得的允许,才能在上传商城产品时拍照上传",
"NSLocationWhenInUseUsageDescription" : "需要获得的允许,才能在修改店铺信息时获取店铺定位",
"NSLocationAlwaysUsageDescription" : "需要获得的允许,才能在修改店铺信息时获取店铺定位",
"NSLocationAlwaysAndWhenInUseUsageDescription" : "需要获得的允许,才能在修改店铺信息时获取店铺定位",
"NSLocationWhenInUseUsageDescription" : "需要获得允许,能精确获取店家位置",
"NSLocationAlwaysUsageDescription" : "需要获得允许,能精确获取您的位置,用于定位导航",
"NSLocationAlwaysAndWhenInUseUsageDescription" : "需要您得同意,才能始终访问位置,用于获取当前定位让能让用户知道所在位置",
"NSContactsUsageDescription" : "需要获得的允许,才能在你管理订单时拨打客户电话",
"NSRemindersUsageDescription" : "需要获得的允许,才能在新订单时提示"
"NSRemindersUsageDescription" : ""
}
},
/* SDK配置 */
......
......@@ -445,7 +445,7 @@
"navigationBarTitleText": "立即发货",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/buyingVegetables/buyingVegetables",
......@@ -455,7 +455,15 @@
"enablePullDownRefresh": false
}
}
],
,{
"path" : "pages/locationDetailed/locationDetailed",
"style" :
{
"navigationBarTitleText": "实时距离",
"enablePullDownRefresh": false
}
}],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "",
......
......@@ -485,7 +485,6 @@
})
getshopclass({}).then(res=>{
if(res.code == 0){
console.log(res.data)
this.ordinary = res.data.ordinary
this.weigh = res.data.weigh
this.classData[1] = Array.from(res.data.ordinary)
......@@ -625,26 +624,25 @@
}
},
async findEleProduct(results){
console.log('查找商品')
console.log(results)
uni.showLoading({title:'请稍后'});
let res=await findEleProduct({code:results.code});
uni.hideLoading();
if(res.code==-1){ //没有就录入
console.log('进入sss');
this.isadd=0;
this.form.manufacturer = results.data.data.supplier
this.form.brand = results.data.data.brand
this.form.code=results.code;//条形码
this.form.original_name = results.data.data.goodsName;
this.form.product_name = results.data.data.goodsName;
this.form.commodity_data = results.data.data;
this.form.price=results.data.data.price;
this.isScanCode=results.isScanCode;
this.codeDisabled=false;//条形码输入框是否禁止输入
if(results.data.msg=='暂未收录此商品'){
this.$set(this.form,'code',results.code);
}else{
this.$set(this,'isadd',0);
this.$set(this.form,'manufacturer',results.data.data.supplier);
this.$set(this.form,'brand',results.data.data.brand);
this.$set(this.form,'original_name',results.data.data.goodsName);
this.$set(this.form,'product_name',results.data.data.goodsName);
this.$set(this.form,'commodity_data',results.data.data);
this.$set(this.form,'price',results.data.data.price);
this.$set(this,'isScanCode',results.isScanCode);
}
this.$set(this,'codeDisabled',false);
}else if(res.code==0){ //有就把信息展示
// console.log('进tsadadadfafasdffsa');
this.isadd=1;
this.form.quality_guarantee_period = res.data.quality_guarantee_period
this.qualitYears = parseInt(res.data.quality_guarantee_period/365)
......
......@@ -328,6 +328,7 @@
<view class="BH"></view>
<Welcome ref="Welcome"></Welcome>
<!-- 欢迎回来 -->
<yomol-upgrade ref="yomolUpgrade"></yomol-upgrade>
</view>
</template>
......@@ -344,6 +345,7 @@
storeIndex,
excel
} from "@/utils/api/api.js";
import yomolUpgrade from '@/components/yomol-upgrade/yomol-upgrade.vue'; //升级组件
export default {
data() {
return {
......@@ -362,6 +364,7 @@
uniIcon,
uniBadge,
Welcome,
yomolUpgrade,
},
computed: {
storeinfo() {
......@@ -394,9 +397,10 @@
if (uni.getSystemInfoSync().platform != 'ios') {
getApp().hgServiceFun();
}else{
getApp().getIosLocation(2,'index');
}
//#endif
},
//下拉刷新
onPullDownRefresh() {
......@@ -404,6 +408,12 @@
// uni.stopPullDownRefresh();//结束下拉刷新
},
onShow() {
//检测更新
setTimeout(() => {
// #ifdef APP-PLUS
this.$refs.yomolUpgrade.checkVersionClick();
// #endif
}, 1000)
getskipShop({
type: 'bld'
}).then(res => {
......@@ -429,8 +439,10 @@
} else {
if (uni.getStorageSync('dwstatus') == 3 || uni.getStorageSync('dwstatus') == 0) {
//this.$api.msg('不是第一次')
getApp().getIosLocation(2);
} else {
getApp().getIosLocation(2,'index');
}else {
//this.$api.msg('第一次')
getApp().getnewsRemind().then(res => {
if (res) {
......
<template>
<view >
<map
:style="{height:+Height+'px',width:'100vh'}"
scale='15'
:latitude="latitude"
:longitude="longitude"
:markers="markers"
:polyline="polyline"
>
</map>
</view>
</template>
<script>
import amapFile from '@/js/amap-uni.js';//高德地图apka
var Amap = new amapFile.AMapWX({key:'b84c9f51c744968cbf96de27249a2221'}); //高德地图小程序key
export default {
data() {
return {
Height:0,
longitude: 115.923535,
latitude: 28.687224,
markers: [
{
id: 0,
width: 23,
height: 33,
latitude: 28.687224,
longitude: 115.923535,
iconPath: "/static/tab-my-current.png",
},
{
id: 1,
width: 20,
height: 30,
latitude: 28.687284,
longitude: 115.909866,
iconPath: "/static/jiesu.png",
},
],
polyline: [], //路线
destination:'',//用户的经纬度位置
}
},
computed: {
horse_lat() {
return this.$store.state.horse_lat;
},
},
watch:{
horse_lat(val){
this.markers[0].longitude=this.longitude=this.$store.state.horse_lng;
this.markers[0].latitude=this.latitude=this.$store.state.horse_lat;
this.getRidingRouteFun();
}
},
onLoad(options){
uni.getSystemInfo({
success: res => {
this.Height = res.windowHeight; //屏幕显示区域高度
}
});
this.markers[0].longitude=this.longitude=this.$store.state.horse_lng;
this.markers[0].latitude=this.latitude=this.$store.state.horse_lat;
this.destination=options.userlng+','+options.userlat;
this.markers[1].longitude=options.userlng;
this.markers[1].latitude=options.userlat;
this.getRidingRouteFun();
},
methods: {
getRidingRouteFun(){
console.log(this.longitude+','+this.latitude)
Amap.getRidingRoute({
origin:this.longitude+','+this.latitude,
destination: this.destination,
success: (data)=>{
var points = [];
if(data.paths && data.paths[0] && data.paths[0].steps){
var steps = data.paths[0].steps;
for(var i = 0; i < steps.length; i++){
var poLen = steps[i].polyline.split(';');
for(var j = 0;j < poLen.length; j++){
points.push({
longitude: parseFloat(poLen[j].split(',')[0]),
latitude: parseFloat(poLen[j].split(',')[1])
})
}
}
}
this.polyline=[{
points: points,
color: "#0091ff",
width: 20
}]
}
})
},
}
}
</script>
<style>
</style>
......@@ -132,10 +132,8 @@
is_dianping:"",//点评
sale_status:""//售后状态
}).then(res => {
console.log(res,order_id,'这里了')
uni.hideLoading();
for(let item of res.data){
console.log(item,'这里了')
if(item.order_id==order_id){
this.$set(this.orderlist,index,item);
break;
......
......@@ -10,7 +10,7 @@
<view class="boxs">
<view class="topbox_20 addresone" v-if="detail.delivery_type>=1">
<view class="ali-c">
<view class="weizhiimg">
<view class="weizhiimg" >
<image class="imgs" src="/static/news/address.png"></image>
</view>
<view class="flex1 ml-20 addrnamesv">
......@@ -21,8 +21,8 @@
</view>
<view class="topbox_20 mt-60 addresone" v-else>
<view class="ali-c">
<view class="weizhiimg">
<image class="imgs" src="/static/news/storeicon.png"></image>
<view class="" style="width: 32upx;">
<image class="imgs" src="/static/news/storeicon.png" mode="widthFix" style="display: block;"></image>
</view>
<view class="flex1 ml-20">
<view class="sz_30 bt_hei">到店支付</view>
......
......@@ -13,10 +13,10 @@
<image class="jiantousi" src="/static/news/jiantousi.png" mode=""></image>
</view>
<view class="list-cell b-b m-t" v-if="platform=='ios'" hover-class="cell-hover" :hover-stay-time="50" @click="qiDong">
<text class="cell-tit">ios后台播报权限</text>
<!-- <view class="list-cell b-b m-t" v-if="platform=='ios'" hover-class="cell-hover" :hover-stay-time="50" @click="qiDong">
<text class="cell-tit">允许后台启动</text>
<image class="jiantousi" src="/static/news/jiantousi.png" mode=""></image>
</view>
</view> -->
<navigator url="/pages/edit/Qualifications/Qualifications" class="list-cell b-b" hover-class="cell-hover" :hover-stay-time="50">
<text class="cell-tit">相关资质</text>
......@@ -149,7 +149,6 @@
methods:{
qiDong(){
if(this.platform=='ios'){
getApp().getIosLocation(2);
}else{
......
......@@ -115,7 +115,9 @@
uni.hideLoading();
},
fail:err=>{
console.log(err)
if(err.errCode==-100){
this.$api.msg('系统繁忙,请稍后再试');
}
}
});
//#endif
......@@ -123,13 +125,6 @@
},
shareToFriend(type){
uni.getProvider({
service: 'oauth',
success: function (res) {
console.log(res.provider)
}
});
let wxType='';
if(type==3){//收藏
wxType='WXSceneFavorite';
......
......@@ -77,9 +77,20 @@ const store = new Vuex.Store({
isvoice:true,//是否播放语音提示
Timer:'', //实时获取订单消息的定时器
horse_lng:0,
horse_lat:0,
is_closed:1, //0开启订单列表里的导航按钮 1关闭
},
mutations: {
is_closed(state,data){
state.is_closed=data;
},
horseLng(state,data){
state.horse_lng=data;
},
horseLat(state,data){
state.horse_lat=data;
},
Timer(state,type){
state.Timer=type;
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment