Commit 64569358 authored by geruidan's avatar geruidan

分享测试

parent fec32546
...@@ -3,15 +3,15 @@ ...@@ -3,15 +3,15 @@
*/ */
// export const BASE_URL = 'http://172.18.0.229:9001' //后台根域名 https://demo.shopro.top // export const BASE_URL = 'http://172.18.0.229:9001' //后台根域名 https://demo.shopro.top
export const BASE_URL = 'https://wx.zhonghuihaotai.com' //后台根域名 https://demo.shopro.top export const BASE_URL = 'https://wxcs.zhonghuihaotai.com' //后台根域名 https://demo.shopro.top
// export const BASE_URL = 'https://wxcs.zhonghuihaotai.com' //后台根域名 https://demo.shopro.top // export const BASE_URL = 'https://wxcs.zhonghuihaotai.com' //后台根域名 https://demo.shopro.top
export const API_URL = `${BASE_URL}/api/a1/` //后台接口域名 export const API_URL = `${BASE_URL}/api/a1/` //后台接口域名
export const IMG_URL = 'http://file.shopro.top' //全局网络图片地址变量,css背景图片地址变量在uni.scss export const IMG_URL = 'http://file.shopro.top' //全局网络图片地址变量,css背景图片地址变量在uni.scss
export const MAP_KEY = '426ebc3f1bbaced***89ee6061a98'; //高德地图开发者Web服务key,逆坐标解析 export const MAP_KEY = '426ebc3f1bbaced***89ee6061a98'; //高德地图开发者Web服务key,逆坐标解析
export const HAS_LIVE = false //后台是否开通直播权限,根据情况在manifest.json中,开启注释相应组件的引入,pages.json中打开直播 export const HAS_LIVE = false //后台是否开通直播权限,根据情况在manifest.json中,开启注释相应组件的引入,pages.json中打开直播
// http://172.18.1.66:9001/api/a1/mall/homePage/mp?code={前端传入的code} // http://172.18.1.66:9001/api/a1/mall/homePage/mp?code={前端传入的code}
export const MALL_ID ="150076611100683"; export const MALL_ID ="106975910000477";
export const COMPANY_ID ="2023053101"; export const COMPANY_ID ="999999998";
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
"quickapp" : {}, "quickapp" : {},
/* 小程序特有相关 */ /* 小程序特有相关 */
"mp-weixin" : { "mp-weixin" : {
"appid" : "wxb46902f9572bfa50", "appid" : "wx60c6530c49c52ff7",
"setting" : { "setting" : {
"urlCheck" : true, "urlCheck" : true,
"minified" : false, "minified" : false,
...@@ -62,11 +62,7 @@ ...@@ -62,11 +62,7 @@
"postcss" : true "postcss" : true
}, },
"usingComponents" : true, "usingComponents" : true,
"permission" : { "permission" : {}
"scope.userLocation" : {
"desc" : "获取您的信息位置"
}
}
}, },
"mp-alipay" : { "mp-alipay" : {
"usingComponents" : true "usingComponents" : true
......
...@@ -16,7 +16,9 @@ ...@@ -16,7 +16,9 @@
data() { data() {
return { return {
webUrl:'', webUrl:'',
appointPage:'' appointPage:'',
getMsg:"",
goodsId:''
} }
} , } ,
onReady(){ onReady(){
...@@ -24,6 +26,8 @@ ...@@ -24,6 +26,8 @@
}, },
methods:{ methods:{
handleMsg(e){ handleMsg(e){
this.getMsg = e.detail.data
console.log('收到来自webview的消息:', e.detail.data);
// uni.navigateToMiniProgram({ // uni.navigateToMiniProgram({
// orderId: data.orderId, // orderId: data.orderId,
// }); // });
...@@ -34,7 +38,7 @@ ...@@ -34,7 +38,7 @@
if (!res.code && res.data) { if (!res.code && res.data) {
let code = res.data.sfCode; let code = res.data.sfCode;
let time = new Date().getTime(); let time = new Date().getTime();
this.webUrl= `${BASE_URL}/webpage/wxdist/index.html#/${this.appointPage?this.appointPage:""}?mallId=${MALL_ID}&companyId=${COMPANY_ID}&time=${time}&sfCode=${code}&authMode=force` this.webUrl= `${BASE_URL}/webpage/wxdist/index.html#/${this.appointPage?this.appointPage:""}?mallId=${MALL_ID}&companyId=${COMPANY_ID}&time=${time}&sfCode=${code}&authMode=force&goodsId=${this.goodsId}`
console.log(this.webUrl) console.log(this.webUrl)
console.log(this.webUrl) console.log(this.webUrl)
} }
...@@ -43,12 +47,25 @@ ...@@ -43,12 +47,25 @@
} }
}, },
onLoad(option){ onLoad(option){
this.appointPage = option.appointPage;//指定页面 console.log("先拿到")
// uni.hideTabBar(); console.log(option)
this.appointPage = option.appointPage?option.appointPage:"";//指定页面
this.goodsId = option.goodsId
this.saveMiniCode(); this.saveMiniCode();
}, },
onShareAppMessage(res){
let path = "pages/index/defalutScreen"
if(this.getMsg){
path = `pages/index/defalutScreen?${this.getMsg[0].action}`
}
return {
path: path
}
},
onLaunch(){ onLaunch(){
} }
} }
</script> </script>
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
<!-- 康喜生鲜 --> <!-- 康喜生鲜 -->
<!-- <image class="bg" src="https://img.zhonghuihaotai.com/file_20230711101151AaeuQ.png" mode="scaleToFill" /> --> <!-- <image class="bg" src="https://img.zhonghuihaotai.com/file_20230711101151AaeuQ.png" mode="scaleToFill" /> -->
<!-- :disabled="loading" --> <!-- :disabled="loading" -->
<button @click="enter" class="btn"> <button @click="enter" :disabled="butDis" class="btn">
马上进入 {{butTips}}
</button> </button>
</view> </view>
</view> </view>
...@@ -41,7 +41,10 @@ ...@@ -41,7 +41,10 @@
checkSessionStatus: false, checkSessionStatus: false,
loading: true, loading: true,
companyId:"" , companyId:"" ,
defalutBg:defalutBg defalutBg:defalutBg,
butTips:"马上进入",
butDis:false,
path:"/pages/h5/index"
} }
}, },
computed: { computed: {
...@@ -51,9 +54,11 @@ ...@@ -51,9 +54,11 @@
...mapActions(['getPhoneNumber', 'registerInfoFn', 'authCheck', 'getUserInfo','enterprise']), ...mapActions(['getPhoneNumber', 'registerInfoFn', 'authCheck', 'getUserInfo','enterprise']),
// 马上进入 // 马上进入
enter() { enter() {
this.butTips="请稍候..."
this.butDis = true
if (this.unregistered && !this.loading) { if (this.unregistered && !this.loading) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/h5/index', url: this.path,
}) })
}else{ }else{
this.getInfoPhoneNumber() this.getInfoPhoneNumber()
...@@ -65,8 +70,10 @@ ...@@ -65,8 +70,10 @@
if (register) { //注册成功 if (register) { //注册成功
this.unregistered = true; this.unregistered = true;
uni.navigateTo({ uni.navigateTo({
url: '/pages/h5/index', url: this.path,
}) })
}else{
this.butDis = false
} }
}, },
// 获取手机号 // 获取手机号
...@@ -79,7 +86,7 @@ ...@@ -79,7 +86,7 @@
url: '/pages/user/enterprise' url: '/pages/user/enterprise'
}) })
} }
}, },
async auth() { async auth() {
let auth = await this.authCheck(); let auth = await this.authCheck();
console.log("调用authcheck的值"+auth) console.log("调用authcheck的值"+auth)
...@@ -168,6 +175,8 @@ ...@@ -168,6 +175,8 @@
}, },
onHide() {}, onHide() {},
onShow() { onShow() {
this.butDis = false
this.butTips = "马上进入"
// uni.hideTabBar(); // uni.hideTabBar();
}, },
onReady() { onReady() {
...@@ -184,13 +193,24 @@ ...@@ -184,13 +193,24 @@
uni.setStorageSync("companyId",this.companyId ) uni.setStorageSync("companyId",this.companyId )
this.getAuth(); this.getAuth();
}, },
onShareAppMessage(res){ onShareAppMessage(res){
return { return {
path: 'pages/index/defalutScreen' path: 'pages/index/defalutScreen'
} }
}, },
onLoad(options){ onLoad(option){
console.log("分享过来的")
console.log(this.$Route.query)
console.log(this.$Route)
console.log("结束拉.....")
// fullPath: "/pages/index/defalutScreen?goodsId=9817&mallId=106975910000477&path=%2FdetailPage
if(this.$Route.query.path == '/detailPage') {
// if(this.$Route.fullPath.indexOf('detailPage') >-1) {
this.path = `/pages/h5/index?appointPage=detailPage&goodsId=${this.$Route.query.goodsId}`
// }
}
console.log(this.path)
} }
} }
......
...@@ -206,7 +206,7 @@ const actions = { ...@@ -206,7 +206,7 @@ const actions = {
duration: 2000, duration: 2000,
icon:'none' icon:'none'
}); });
reject(res.data); reject(0);
} }
}) })
}) })
......
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