Commit a7457a32 authored by home's avatar home

zxf

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