|
@@ -22,46 +22,57 @@
|
|
|
onLoad(opt) {
|
|
|
var that=this;
|
|
|
this.wxOpendata=uni.getStorageSync("wxOpendata");
|
|
|
- this.logindata=uni.getStorageSync("logindata")
|
|
|
- uni.getLocation({
|
|
|
- type: 'gcj02',
|
|
|
- success: function (res) {
|
|
|
- console.log('当前位置的经度是:' + res.longitude);
|
|
|
- console.log('当前位置的纬度:' + res.latitude);
|
|
|
- if(opt.id){
|
|
|
- that.url=that.$webURL+'paySuccess?orderId='+opt.id+'&hideHeader=true&codeapp='+that.wxOpendata.code+'&lat='+res.latitude+'&lng='+res.longitude
|
|
|
- }else{
|
|
|
- /* if(!that.wxOpendata.shopID||!that.logindata){
|
|
|
- uni.navigateTo({
|
|
|
- url:'../login/empower'
|
|
|
- })
|
|
|
- } */
|
|
|
-
|
|
|
- if(that.wxOpendata.code){
|
|
|
- //this.url='http://dms.32che.cn/#/carOwner/index?codeapp='+this.wxOpendata.code+ '&shopId='+this.wxOpendata.shopID
|
|
|
- that.url=that.$webURL+'carOwner/index?codeapp='+that.wxOpendata.code+ '&shopId='+that.wxOpendata.shopID+'&lat='+res.latitude+'&lng='+res.longitude
|
|
|
+ this.logindata=uni.getStorageSync("logindata");
|
|
|
+ if (opt.path) {
|
|
|
+ //this.url = `${this.url}${options.path}`
|
|
|
+ //this.url = opt.path
|
|
|
+ console.log('options', opt)
|
|
|
+ //console.log(opt)
|
|
|
+ var url=opt.path.replace('$', '?')
|
|
|
+ this.url=url+"&codeapp="+that.wxOpendata.code+'&shareID='+opt.shareID+'&type='+opt.type+'&isDmsOpen='+that.wxOpendata.isDmsOpen+'&isMarketingOpen='+that.wxOpendata.isMarketingOpen
|
|
|
+ console.log(url)
|
|
|
+ }else{
|
|
|
+ uni.getLocation({
|
|
|
+ type: 'gcj02',
|
|
|
+ success: function (res) {
|
|
|
+ console.log('当前位置的经度是:' + res.longitude);
|
|
|
+ console.log('当前位置的纬度:' + res.latitude);
|
|
|
+ if(opt.id){
|
|
|
+ that.url=that.$webURL+'paySuccess?orderId='+opt.id+'&hideHeader=true&codeapp='+that.wxOpendata.code+'&lat='+res.latitude+'&lng='+res.longitude+'&isDmsOpen='+that.wxOpendata.isDmsOpen+'&isMarketingOpen='+that.wxOpendata.isMarketingOpen
|
|
|
}else{
|
|
|
- that.url=that.$webURL+'carOwner/index?codeapp=&shopId=&lat='+res.latitude+'&lng='+res.longitude
|
|
|
+ /* if(!that.wxOpendata.shopID||!that.logindata){
|
|
|
+ uni.navigateTo({
|
|
|
+ url:'../login/empower'
|
|
|
+ })
|
|
|
+ } */
|
|
|
+
|
|
|
+ if(that.wxOpendata.code){
|
|
|
+ //this.url='http://dms.32che.cn/#/carOwner/index?codeapp='+this.wxOpendata.code+ '&shopId='+this.wxOpendata.shopID
|
|
|
+ that.url=that.$webURL+'carOwner/index?codeapp='+that.wxOpendata.code+ '&shopId='+that.wxOpendata.shopID+'&lat='+res.latitude+'&lng='+res.longitude+'&isDmsOpen='+that.wxOpendata.isDmsOpen+'&isMarketingOpen='+that.wxOpendata.isMarketingOpen
|
|
|
+ }else{
|
|
|
+ that.url=that.$webURL+'carOwner/index?codeapp=&shopId=&lat='+res.latitude+'&lng='+res.longitude
|
|
|
+ }
|
|
|
}
|
|
|
+ },
|
|
|
+ fail(err) {
|
|
|
+ console.log(err)
|
|
|
+ if(opt.id){
|
|
|
+ that.url=that.$webURL+'paySuccess?orderId='+opt.id+'&hideHeader=true&codeapp='+that.wxOpendata.code+'&lat=""&lng=""'
|
|
|
+ }else{
|
|
|
+ if(!that.wxOpendata.shopID){
|
|
|
+ uni.navigateTo({
|
|
|
+ url:'../login/empower'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(that.wxOpendata.code){
|
|
|
+ //this.url='http://dms.32che.cn/#/carOwner/index?codeapp='+this.wxOpendata.code+ '&shopId='+this.wxOpendata.shopID
|
|
|
+ that.url=that.$webURL+'carOwner/index?codeapp='+that.wxOpendata.code+ '&shopId='+that.wxOpendata.shopID+'&lat=""&lng=""'
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- },
|
|
|
- fail(err) {
|
|
|
- console.log(err)
|
|
|
- if(opt.id){
|
|
|
- that.url=that.$webURL+'paySuccess?orderId='+opt.id+'&hideHeader=true&codeapp='+that.wxOpendata.code+'&lat=""&lng=""'
|
|
|
- }else{
|
|
|
- if(!that.wxOpendata.shopID){
|
|
|
- uni.navigateTo({
|
|
|
- url:'../login/empower'
|
|
|
- })
|
|
|
- }
|
|
|
- if(that.wxOpendata.code){
|
|
|
- //this.url='http://dms.32che.cn/#/carOwner/index?codeapp='+this.wxOpendata.code+ '&shopId='+this.wxOpendata.shopID
|
|
|
- that.url=that.$webURL+'carOwner/index?codeapp='+that.wxOpendata.code+ '&shopId='+that.wxOpendata.shopID+'&lat=""&lng=""'
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
console.log(opt)
|
|
|
//opt.id='3A9DBC40-D5D4-43A6-8ACA-5CF909771512'
|
|
@@ -77,13 +88,52 @@
|
|
|
},
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
methods: {
|
|
|
goUrl(){
|
|
|
|
|
|
},
|
|
|
- message(event){
|
|
|
- console.log(event);
|
|
|
- }
|
|
|
+ message(event){
|
|
|
+ console.log(event);
|
|
|
+ let { data } = event.mp.detail
|
|
|
+ console.log('message', data)
|
|
|
+ this.shareData = JSON.parse(data.pop())
|
|
|
+ console.log(this.shareData)
|
|
|
+ //this.shareData= event.mp.detail
|
|
|
+ },
|
|
|
+ },
|
|
|
+ onShareAppMessage(){
|
|
|
+ console.log(this.shareData)
|
|
|
+ /* var share={
|
|
|
+ url:this.shareData.path
|
|
|
+ }
|
|
|
+ var obj=JSON.stringify(share) */
|
|
|
+ var newUrl=this.shareData.path.replace('?', '$')
|
|
|
+ console.log(newUrl)
|
|
|
+ /*
|
|
|
+ if (this.shareData) {
|
|
|
+ path = shareData.path
|
|
|
+ } */
|
|
|
+ return {
|
|
|
+ title:this.shareData.title,
|
|
|
+ path: 'pages/index/index?path='+ encodeURI(newUrl),
|
|
|
+ //path: 'pages/index/home?path='+ obj+'&id='+this.shareData.id+'&shareID='+this.shareData.shareID,
|
|
|
+ imageUrl:this.shareData.img,
|
|
|
+ desc:this.shareData.desc,
|
|
|
+ success: function (res) {
|
|
|
+ // 转发成功
|
|
|
+ wx.showToast({
|
|
|
+ title: "转发成功",
|
|
|
+ icon: 'success',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fail: function (res) {
|
|
|
+ // 转发失败
|
|
|
+ },
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|