|
@@ -1,21 +1,9 @@
|
|
|
const app = getApp();
|
|
|
|
|
|
Page({
|
|
|
- options: {},
|
|
|
pid: '',
|
|
|
onLoad: function (options) {
|
|
|
- this.options = options;
|
|
|
- //产品详情路径附带参数,用于来源分享的参数scene = uid, product_id
|
|
|
- if (typeof options.scene == 'undefined') {//来源首页商品浏览
|
|
|
- this.pid = options.id;
|
|
|
- } else {//来源于分享
|
|
|
- //海报分享,路径附带的参数 encodeURIComponent(uid, product_id)
|
|
|
- let str = decodeURIComponent(options.scene);
|
|
|
- let arr = str.split(',');
|
|
|
- let uid = arr[0];
|
|
|
- this.pid = arr[1];
|
|
|
- app.saveInviteUid(uid);
|
|
|
- }
|
|
|
+ this.pid = options.id;
|
|
|
var that = this;
|
|
|
app.showLoading();
|
|
|
app.request('product.api.view', {id: this.pid}, {
|