备份
This commit is contained in:
2
app.js
2
app.js
@@ -178,7 +178,7 @@ App({
|
|||||||
},
|
},
|
||||||
globalData:{
|
globalData:{
|
||||||
userInfo:null,
|
userInfo:null,
|
||||||
apiurl:"https://vip.agqyjs.com",//"http://localhost:8080",//http://localhost:24382 //https://vip.agqyjs.com
|
apiurl:"http://localhost:24382",//"http://localhost:8080",//http://localhost:24382 //https://vip.agqyjs.com
|
||||||
IFRefreshCart:0,
|
IFRefreshCart:0,
|
||||||
IFRefreshsell:0,
|
IFRefreshsell:0,
|
||||||
IFRefreshsell0:0,
|
IFRefreshsell0:0,
|
||||||
|
|||||||
3
app.json
3
app.json
@@ -118,6 +118,9 @@
|
|||||||
"permission": {
|
"permission": {
|
||||||
"scope.userLocation": {
|
"scope.userLocation": {
|
||||||
"desc": "你的位置信息将用于标注自提地址距离"
|
"desc": "你的位置信息将用于标注自提地址距离"
|
||||||
|
},
|
||||||
|
"scope.writePhotosAlbum": {
|
||||||
|
"desc": "保存二维码到相册,方便分享给好友"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"debug": true,
|
"debug": true,
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ Page({
|
|||||||
{
|
{
|
||||||
icon: '../../images/my_ico1.png',
|
icon: '../../images/my_ico1.png',
|
||||||
url: (userInfo.sjuLevel0 == 2 ? '../mybusiness0/index' : (userInfo.sjuLevel0 == 1 ? '' : '../appbusiness0/index')),
|
url: (userInfo.sjuLevel0 == 2 ? '../mybusiness0/index' : (userInfo.sjuLevel0 == 1 ? '' : '../appbusiness0/index')),
|
||||||
text: (userInfo.sjuLevel0 == 2 ? '事业部管理' : (userInfo.sjuLevel0 == 1 ? '申请健康驿站正在审核中...' : '申请健康驿站'))
|
text: (userInfo.sjuLevel0 == 2 ? '健康驿站管理' : (userInfo.sjuLevel0 == 1 ? '申请健康驿站正在审核中...' : '申请健康驿站'))
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: '../../images/my_ico3.png',
|
icon: '../../images/my_ico3.png',
|
||||||
|
|||||||
@@ -107,8 +107,51 @@ Page( {
|
|||||||
that.setData({
|
that.setData({
|
||||||
savetitle:"保存中,请稍候..."
|
savetitle:"保存中,请稍候..."
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 检查权限
|
||||||
|
wx.getSetting({
|
||||||
|
success: function(res) {
|
||||||
|
if (!res.authSetting['scope.writePhotosAlbum']) {
|
||||||
|
// 未授权,请求授权
|
||||||
|
wx.authorize({
|
||||||
|
scope: 'scope.writePhotosAlbum',
|
||||||
|
success: function() {
|
||||||
|
// 授权成功,执行保存
|
||||||
|
that.saveImage();
|
||||||
|
},
|
||||||
|
fail: function() {
|
||||||
|
// 授权失败,引导用户去设置
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '需要授权保存到相册权限',
|
||||||
|
confirmText: '去授权',
|
||||||
|
success: function(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
wx.openSetting({
|
||||||
|
success: function(settingRes) {
|
||||||
|
if (settingRes.authSetting['scope.writePhotosAlbum']) {
|
||||||
|
that.saveImage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 已授权,直接保存
|
||||||
|
that.saveImage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 提取保存图片的逻辑到单独函数
|
||||||
|
saveImage: function() {
|
||||||
var userId = wx.getStorageSync("userId")
|
var userId = wx.getStorageSync("userId")
|
||||||
var LoginId = wx.getStorageSync("LoginId")
|
var LoginId = wx.getStorageSync("LoginId")
|
||||||
|
|
||||||
wx.canvasToTempFilePath({
|
wx.canvasToTempFilePath({
|
||||||
canvasId: "myCanvas",
|
canvasId: "myCanvas",
|
||||||
destWidth: 520,
|
destWidth: 520,
|
||||||
@@ -140,30 +183,11 @@ Page( {
|
|||||||
},
|
},
|
||||||
fail: function(err) {
|
fail: function(err) {
|
||||||
console.log('saveImageToPhotosAlbum fail:', err);
|
console.log('saveImageToPhotosAlbum fail:', err);
|
||||||
if (err.errMsg.indexOf('auth deny') > -1 || err.errMsg.indexOf('authorize') > -1) {
|
|
||||||
wx.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: '需要授权保存到相册权限',
|
|
||||||
confirmText: '去授权',
|
|
||||||
success: function (res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
wx.openSetting({
|
|
||||||
success: function(settingRes) {
|
|
||||||
if (settingRes.authSetting['scope.writePhotosAlbum']) {
|
|
||||||
that.onxz(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: '保存失败:' + err.errMsg,
|
title: '保存失败:' + err.errMsg,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 3000
|
duration: 3000
|
||||||
})
|
})
|
||||||
}
|
|
||||||
that.setData({
|
that.setData({
|
||||||
savetitle:"保存商家收款码到相册"
|
savetitle:"保存商家收款码到相册"
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="login_box" style=" margin-top:0.8em;">
|
<!-- <view class="login_box" style=" margin-top:0.8em;">
|
||||||
<view class="mybusiness_title">我的货款</view>
|
<view class="mybusiness_title">我的货款</view>
|
||||||
<view class="mydata_box0 jfbox" style="border-radius:0;">
|
<view class="mydata_box0 jfbox" style="border-radius:0;">
|
||||||
<view id="djhkye">
|
<view id="djhkye">
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
<text>{{kdordercount2}}</text>
|
<text>{{kdordercount2}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<view class="login_box" style=" margin-top:0.8em">
|
<view class="login_box" style=" margin-top:0.8em">
|
||||||
<view class="mybusiness_title">自提订单<view class="close" bindtap="onorders" data-index="3" data-id="0">全部订单</view></view>
|
<view class="mybusiness_title">自提订单<view class="close" bindtap="onorders" data-index="3" data-id="0">全部订单</view></view>
|
||||||
<view class="mydata_box0 orderbox">
|
<view class="mydata_box0 orderbox">
|
||||||
|
|||||||
@@ -556,8 +556,10 @@ Page( {
|
|||||||
})
|
})
|
||||||
},onorderdetail:function(e) {
|
},onorderdetail:function(e) {
|
||||||
var id = e.currentTarget.dataset.id
|
var id = e.currentTarget.dataset.id
|
||||||
|
//var orderid ="26032416461968";
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: "../myorderinfo/index?id=" + id + "&t=" + that.data.t
|
url: "../myorderinfo/index?id=" + id + "&t=" + that.data.t
|
||||||
|
//url: "../myorderinfo/index?orderid=" + orderid + "&t=" + that.data.t
|
||||||
})
|
})
|
||||||
},ondetail:function(e) {
|
},ondetail:function(e) {
|
||||||
var id = e.currentTarget.dataset.id
|
var id = e.currentTarget.dataset.id
|
||||||
|
|||||||
@@ -156,6 +156,48 @@ Page( {
|
|||||||
that.setData({
|
that.setData({
|
||||||
savetitle:"保存中,请稍候..."
|
savetitle:"保存中,请稍候..."
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 检查权限
|
||||||
|
wx.getSetting({
|
||||||
|
success: function(res) {
|
||||||
|
if (!res.authSetting['scope.writePhotosAlbum']) {
|
||||||
|
// 未授权,请求授权
|
||||||
|
wx.authorize({
|
||||||
|
scope: 'scope.writePhotosAlbum',
|
||||||
|
success: function() {
|
||||||
|
// 授权成功,执行保存
|
||||||
|
that.saveImage();
|
||||||
|
},
|
||||||
|
fail: function() {
|
||||||
|
// 授权失败,引导用户去设置
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '需要授权保存到相册权限',
|
||||||
|
confirmText: '去授权',
|
||||||
|
success: function(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
wx.openSetting({
|
||||||
|
success: function(settingRes) {
|
||||||
|
if (settingRes.authSetting['scope.writePhotosAlbum']) {
|
||||||
|
that.saveImage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 已授权,直接保存
|
||||||
|
that.saveImage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 提取保存图片的逻辑到单独函数
|
||||||
|
saveImage: function() {
|
||||||
var userId = wx.getStorageSync("userId")
|
var userId = wx.getStorageSync("userId")
|
||||||
var LoginId = wx.getStorageSync("LoginId")
|
var LoginId = wx.getStorageSync("LoginId")
|
||||||
|
|
||||||
@@ -190,30 +232,11 @@ Page( {
|
|||||||
},
|
},
|
||||||
fail: function(err) {
|
fail: function(err) {
|
||||||
console.log('saveImageToPhotosAlbum fail:', err);
|
console.log('saveImageToPhotosAlbum fail:', err);
|
||||||
if (err.errMsg.indexOf('auth deny') > -1 || err.errMsg.indexOf('authorize') > -1) {
|
|
||||||
wx.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: '需要授权保存到相册权限',
|
|
||||||
confirmText: '去授权',
|
|
||||||
success: function (res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
wx.openSetting({
|
|
||||||
success: function(settingRes) {
|
|
||||||
if (settingRes.authSetting['scope.writePhotosAlbum']) {
|
|
||||||
that.onsavepic(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: '保存失败:' + err.errMsg,
|
title: '保存失败:' + err.errMsg,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 3000
|
duration: 3000
|
||||||
})
|
})
|
||||||
}
|
|
||||||
that.setData({
|
that.setData({
|
||||||
savetitle:"保存二维码到相册"
|
savetitle:"保存二维码到相册"
|
||||||
})
|
})
|
||||||
@@ -232,7 +255,6 @@ Page( {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
},onsavepic0: function() {
|
},onsavepic0: function() {
|
||||||
|
|
||||||
/*wx.saveImageToPhotosAlbum({
|
/*wx.saveImageToPhotosAlbum({
|
||||||
|
|||||||
@@ -8,11 +8,37 @@ Page( {
|
|||||||
|
|
||||||
onLoad: function() {
|
onLoad: function() {
|
||||||
that = this
|
that = this
|
||||||
var addresss = JSON.parse(wx.getStorageSync("addresss"))
|
|
||||||
that.setData({
|
that = this
|
||||||
loadingHidden:true,
|
wx.setBackgroundColor({
|
||||||
myaddress:addresss
|
backgroundColor: "#96C6F5",
|
||||||
})
|
})
|
||||||
|
that.clearCache();//清本页缓存
|
||||||
|
that.getlist(0);//第一次加载数据
|
||||||
|
var sopenFrame0=setInterval(function (){
|
||||||
|
clearInterval(sopenFrame0);
|
||||||
|
wx.getLocation({
|
||||||
|
type: 'gcj02', // 比较精确
|
||||||
|
success: (res) => {
|
||||||
|
wx.setStorageSync("latitude", res.latitude)
|
||||||
|
wx.setStorageSync("longitude", res.longitude)
|
||||||
|
that.clearCache();//清本页缓存
|
||||||
|
that.getlist(0);
|
||||||
|
},fail: (err) => {
|
||||||
|
/*wx.showToast({
|
||||||
|
title: JSON.stringify(err),
|
||||||
|
icon: "none",
|
||||||
|
duration: 20000
|
||||||
|
})*/
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
},1000);
|
||||||
|
// var addresss = JSON.parse(wx.getStorageSync("addresss"))
|
||||||
|
// that.setData({
|
||||||
|
// loadingHidden:true,
|
||||||
|
// myaddress:addresss
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
,select:function(e) {
|
,select:function(e) {
|
||||||
var index = e.currentTarget.dataset.id
|
var index = e.currentTarget.dataset.id
|
||||||
@@ -20,11 +46,101 @@ Page( {
|
|||||||
var type=that.data.myaddress[index].type
|
var type=that.data.myaddress[index].type
|
||||||
var contact=that.data.myaddress[index].contact
|
var contact=that.data.myaddress[index].contact
|
||||||
var tel=that.data.myaddress[index].tel
|
var tel=that.data.myaddress[index].tel
|
||||||
|
var area=that.data.myaddress[index].area
|
||||||
var address=that.data.myaddress[index].address
|
var address=that.data.myaddress[index].address
|
||||||
var distance=that.data.myaddress[index].distance
|
var distance=that.data.myaddress[index].distance
|
||||||
app.globalData.selladdress0={addressId:addressId,type:type,contact:contact,tel:tel,address:address,distance:distance}
|
app.globalData.selladdress0={addressId:addressId,type:type,contact:contact,tel:tel,area:area,address:address,distance:distance}
|
||||||
app.globalData.IFRefreshsell0=1
|
app.globalData.IFRefreshsell0=1
|
||||||
wx.navigateBack({})
|
wx.navigateBack({})
|
||||||
|
|
||||||
|
},
|
||||||
|
// 清缓存
|
||||||
|
clearCache:function(){
|
||||||
|
that.setData({
|
||||||
|
Start: 0,
|
||||||
|
loadingHidden:false
|
||||||
|
});
|
||||||
|
}, getlist: function (gp) {
|
||||||
|
|
||||||
|
var userId = wx.getStorageSync("userId")
|
||||||
|
var LoginId = wx.getStorageSync("LoginId")
|
||||||
|
var latitude = wx.getStorageSync("latitude")
|
||||||
|
var longitude = wx.getStorageSync("longitude")
|
||||||
|
|
||||||
|
wx.request({
|
||||||
|
url: app.globalData.apiurl + "/xapiajax.ashx",
|
||||||
|
data: {
|
||||||
|
action:"getBusinessdata",
|
||||||
|
userId:(!userId?"":userId),
|
||||||
|
LoginId:(!LoginId?"":LoginId),
|
||||||
|
// keyword:that.data.keyword,
|
||||||
|
t:(that.data.nav>0?that.data.nav:""),
|
||||||
|
Start:that.data.Start,
|
||||||
|
latitude:(!latitude?"":latitude),
|
||||||
|
longitude:(!longitude?"":longitude),
|
||||||
|
},
|
||||||
|
method:"GET",
|
||||||
|
dataType:"json",
|
||||||
|
header: {
|
||||||
|
"content-type": "application/json" // 默认值
|
||||||
|
},
|
||||||
|
success (res) {
|
||||||
|
if(res.data.status==1){
|
||||||
|
var tmpArr = null;
|
||||||
|
if(gp==0||gp==1){
|
||||||
|
tmpArr = res.data.Businesslist
|
||||||
|
}else{
|
||||||
|
tmpArr = that.data.business;
|
||||||
|
tmpArr.push.apply(tmpArr,res.data.Businesslist);
|
||||||
}
|
}
|
||||||
|
// 转换Businesslist数据为myaddress期望的格式
|
||||||
|
var myaddressData = res.data.Businesslist.map(function(item) {
|
||||||
|
return {
|
||||||
|
id: item._id,
|
||||||
|
contact: item.name,
|
||||||
|
tel: item.phone,
|
||||||
|
area: '',
|
||||||
|
address: item.address,
|
||||||
|
distance: item.distance
|
||||||
|
};
|
||||||
|
});
|
||||||
|
that.setData({
|
||||||
|
business: tmpArr,
|
||||||
|
myaddress: myaddressData,
|
||||||
|
Start: that.data.Start+res.data.Businesslist.length,
|
||||||
|
loadingHidden:true
|
||||||
|
})
|
||||||
|
if(gp==0||gp==1){
|
||||||
|
that.setData({
|
||||||
|
navData:res.data.lbs
|
||||||
|
})
|
||||||
|
if(res.data.Businesslist.length==0){
|
||||||
|
that.setData({
|
||||||
|
nodataHidden:false
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
that.setData({
|
||||||
|
nodataHidden:true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(res.data.msg=="您未登录"){
|
||||||
|
wx.removeStorageSync('userId')
|
||||||
|
wx.removeStorageSync('LoginId')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(gp==0||gp==1){
|
||||||
|
//隐藏loading 提示框
|
||||||
|
wx.hideLoading();
|
||||||
|
//隐藏导航条加载动画
|
||||||
|
wx.hideNavigationBarLoading();
|
||||||
|
//停止下拉刷新
|
||||||
|
wx.stopPullDownRefresh();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -634,7 +634,7 @@ Page( {
|
|||||||
name:that.data.a_name,
|
name:that.data.a_name,
|
||||||
tel:that.data.a_tel,
|
tel:that.data.a_tel,
|
||||||
agentid:that.data.agentid,
|
agentid:that.data.agentid,
|
||||||
agenttype:that.data.agenttype,
|
agenttype:(!that.data.agenttype?1:that.data.agenttype),
|
||||||
Guests:Guests,
|
Guests:Guests,
|
||||||
image:that.data.image,
|
image:that.data.image,
|
||||||
image0:that.data.image0
|
image0:that.data.image0
|
||||||
@@ -683,11 +683,11 @@ Page( {
|
|||||||
//JSON.stringify(res)
|
//JSON.stringify(res)
|
||||||
console.log('开始微信支付:',res);
|
console.log('开始微信支付:',res);
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: "用户取消",
|
title: "支付失败",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 3000
|
duration: 1000
|
||||||
})
|
})
|
||||||
wx.navigateBack({})
|
//wx.navigateBack({})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user