Commit bb856523 by 张卓

新小程序码扫码进入小程序

parent 2a970119
import {requestPOST,requestGET} from "@/utils/request.js";
console.log(process.env,'-----------------config------')
// wx
export default {
//POST /shareSceneRecord/getShareSceneRecord/{sceneCode} 获取分享场景参数记录
getShareSceneRecord(options) {
return requestPOST(`${process.env.OLSHOP_URL}/shareSceneRecord/getShareSceneRecord/${options}`, {});
},
}
\ No newline at end of file
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<script> <script>
import spokesman from "@/api/spokesman.js"; import spokesman from "@/api/spokesman.js";
import shop from "@/api/shop.js"; import shop from "@/api/shop.js";
import indexApi from "@/api/index.js";
import { serialize, getQueryVariable, DFSImg } from "@/utils/index"; import { serialize, getQueryVariable, DFSImg } from "@/utils/index";
export default { export default {
data() { data() {
...@@ -132,6 +133,21 @@ export default { ...@@ -132,6 +133,21 @@ export default {
this.page = options.backpath; this.page = options.backpath;
this.params += "&" + serialize(options.params); this.params += "&" + serialize(options.params);
} else if (options.scene) { } else if (options.scene) {
// console.log()
if(options.scene.indexOf('_') == -1){
//新二维码扫码进入
indexApi.getShareSceneRecord(options.scene).then(res=>{
if(res.data.code == '200'){
this.page = res.data.data.pageUri;
let paramsObj = JSON.parse(res.data.data.scene);
let params = '';
for(let i in paramsObj){
params += "&"+i+'='+paramsObj[i]
}
this.params += params
}
})
}else {
//来自扫码 //来自扫码
// options 中的scene需要使用decodeURIComponent才能获取到生成二维码时传入的scene // options 中的scene需要使用decodeURIComponent才能获取到生成二维码时传入的scene
var scene = decodeURIComponent(options.scene); //参数二维码传递过来的参数 var scene = decodeURIComponent(options.scene); //参数二维码传递过来的参数
...@@ -219,6 +235,9 @@ export default { ...@@ -219,6 +235,9 @@ export default {
console.log(querys, "scene"); console.log(querys, "scene");
console.log(this.page) console.log(this.page)
console.log(this.params) console.log(this.params)
}
// var query = options.query.dentistId; // 参数二维码传递过来的场景参数 // var query = options.query.dentistId; // 参数二维码传递过来的场景参数
} }
console.log("url", this.link + this.page + this.params); console.log("url", this.link + this.page + this.params);
......
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