Commit f146ae1b by 匡雅琴

埋点处理

1 parent 32ed831d
import api from '../request/http'
import api from "../request/http";
module.exports = {
/** 分页查询商城专区的商品信息 */
......@@ -7,169 +7,171 @@ module.exports = {
method: `scrm.api.shopmall.zoneInfo.weapp.goodsPage.HMD`,
pageNum: 1,
pageSize: 999,
...data
})
...data,
});
},
/** 添加购物车 */
addShoppingcart(data) {
return api.post({
method: `scrm.api.shopmall.weapp.shoppingcart.add`,
...data
})
...data,
});
},
/** 购物车删除商品 */
delShoppingcart(data) {
return api.post({
method: `scrm.api.shopmall.weapp.shoppingcart.delete`,
...data
})
...data,
});
},
/** 分页获取购物车 */
getShoppingcartList(data) {
return api.post({
method: `scrm.api.shopmall.weapp.shoppingcart.list`,
...data
})
...data,
});
},
/** 购物车商品变更(比如修改数量) */
updateShoppingcart(data) {
return api.post({
method: `scrm.api.shopmall.weapp.shoppingcart.update`,
...data
})
...data,
});
},
/** 领取确认订单最大优惠券 */
getMaxCoupon(orderGoods) {
return api.fetch('scrm.api.shopmall.weapp.order.coupons.get.HMD', {
orderGoods
})
return api.fetch("scrm.api.shopmall.weapp.order.coupons.get.HMD", {
orderGoods,
});
},
/**购物车结算 */
settlementShoppingcart(data) {
return api.post({
method: `scrm.api.shopmall.weapp.shoppingcart.settlement`,
...data
})
...data,
});
},
/** 创建订单(立即购买) */
createOrder(data) {
return api.post({
method: `scrm.api.shopmall.weapp.order.create`,
...data
})
...data,
});
},
/**创建支付订单(去付款) */
payOrder(data) {
return api.post({
method: `scrm.api.shopmall.weapp.order.createPay`,
...data
})
...data,
});
},
/**订单详情 */
getOrderDetail(orderCode) {
return api.post({
method: `scrm.api.shopmall.weapp.order.detail`,
orderCode
})
orderCode,
});
},
/**获取订单的售后详情 */
getOrderRefundDetail(orderCode) {
return api.post({
method: `scrm.api.shopmall.weapp.orderRefund.detail`,
orderCode
})
orderCode,
});
},
/**活动详情 */
getActivityDetail(id) {
return api.fetch('scrm.api.shopmall.weapp.activity.detail', {
id
})
return api.fetch("scrm.api.shopmall.weapp.activity.detail", {
id,
});
},
/** 根据商品ID获取商品 */
getGoodsDetail(id) {
return api.fetch('scrm.api.shopmall.weapp.goods.getById.HMD', {
return api.fetch("scrm.api.shopmall.weapp.goods.getById.HMD", {
id,
viewAmount: true
})
viewAmount: true,
});
},
/** 获取商品关联优惠券列表 */
getGoodscouponList(data) {
return api.fetch('scrm.api.coupon.seahorse.knife.goods.list', data)
return api.fetch("scrm.api.coupon.seahorse.knife.goods.list", data);
},
/** 领取商品详情优惠券 */
getCoupon(data) {
return api.fetch('scrm.api.coupon.customer.receive', data)
return api.fetch("scrm.api.coupon.customer.receive", data);
},
/**根据规格值组合获取规格组合库存及零售价 */
getGoodsSpecificationExtra(data) {
return api.post({
method: `scrm.api.shopmall.weapp.goods.getGoodsSpecificationExtra`,
...data
})
...data,
});
},
/** 小程序端根据优惠券id查询可使用商品列表(分页) */
getCouponGoodsPage(data) {
data.pageSize = 8
data.pageSize = 8;
return api.post({
method: 'scrm.app.shopmall.coupon.goods.page',
...data
})
method: "scrm.app.shopmall.coupon.goods.page",
...data,
});
},
//取消付款
cancelPay(orderCode) {
return api.fetch('scrm.api.shopmall.weapp.order.cancelPay', {
orderCode
})
return api.fetch("scrm.api.shopmall.weapp.order.cancelPay", {
orderCode,
});
},
/** 申请售后 */
afterSale(data) {
return api.fetch('scrm.api.shopmall.weapp.orderRefund.apply', data)
return api.fetch("scrm.api.shopmall.weapp.orderRefund.apply", data);
},
//申请售后待审核的订单取消售后
cancelOrder(orderCode) {
return api.fetch('scrm.api.shopmall.weapp.orderRefund.cancel', {
orderCode
})
return api.fetch("scrm.api.shopmall.weapp.orderRefund.cancel", {
orderCode,
});
},
/** 为售后添加退货快递信息 */
addDelivery(data) {
return api.post({
method: `scrm.api.shopmall.weapp.orderRefund.addDelivery`,
...data
})
...data,
});
},
requestSubscribeMessage() {
return api.fetch('scrm.api.shopmall.weapp.order.listSubscribeMsgTemplateIds')
return api.fetch(
"scrm.api.shopmall.weapp.order.listSubscribeMsgTemplateIds"
);
},
/** 确认收货 */
confirmReceipt(orderCode) {
return api.post({
method: `scrm.api.shopmall.weapp.order.confirmReceipt`,
orderCode
})
orderCode,
});
},
/**分类列表
*
*
*/
getMerchantClassify(data) {
return api.post({
method: `scrm.api.shopmall.classify.page.curMerchant`,
pageSize: 9999,
currentPage: 1,
...data
})
...data,
});
},
/**分类商品 */
getMerchantClassifyGoods(data) {
......@@ -177,23 +179,23 @@ module.exports = {
method: `scrm.api.shopmall.classify.getById`,
pageSize: 10,
currentPage: 1,
...data
})
...data,
});
},
/** 获取活动分享链接 */
getActivitylink(id) {
return api.post({
method: 'scrm.api.shopmall.activity.get.shared',
id
})
method: "scrm.api.shopmall.activity.get.shared",
id,
});
},
/** 获取商品分享链接 */
getGoodslink(id) {
return api.post({
method: 'scrm.api.shopmall.goods.get.shared',
id
})
method: "scrm.api.shopmall.goods.get.shared",
id,
});
},
removeBuuCar(data) {
return api.post({
......@@ -201,4 +203,12 @@ module.exports = {
...data,
});
},
}
\ No newline at end of file
/**埋点接口 */
trackHttp(data) {
return api.post({
method: "entmicro.api.customercollect.reportCustomerList",
...data,
});
},
};
......@@ -8,7 +8,7 @@ import { router } from "./router/index";
import { getUpdateManager } from "./lib/index";
import utils from "./utils/index";
// 埋点 有需要再引入
// import './utils/track/Track'
import TRACK from './utils/track/Track'
/**分享 */
import '~/utils/share'
App({
......@@ -21,6 +21,7 @@ App({
api,
router,
storage: new utils.cache.Storage(),
$Track: new TRACK(options)
};
// 存储设备信息
console.log(wx.p);
......
......@@ -9,7 +9,7 @@ Page({
// 触发埋点
this.heartbeatFn({
id: options.id,
item_type: 1,
item_type: 6,
view: 1
})
},
......@@ -53,7 +53,7 @@ Page({
business_type: 1,
add_way: 104,
merchant_id: wx.p.storage.get('srcm_shopmall_merchant_id'),
guest_no: wx.$Track.getGuestNo(), //游客ID,
guest_no: wx.p.$Track.getGuestNo(), //游客ID,
user_open_id:this.shareOpenId || ''
}
this.firstEnter = false
......
<view class="strategy-detail-box">
<view class="strategy-detail-title">{{strategyDetailObj.strategyName}}</view>
<view class="strategy-detail-view">{{strategyDetailObj.viewAmount}}人浏览</view>
<image webp src="{{item.strategyImg}}" class="strategy-img"></image>
<view class="strategy-detail-view">{{strategyDetailObj.viewAmount || 0}}人浏览</view>
<image webp src="{{strategyDetailObj.strategyImg}}" class="strategy-img"></image>
<mp-html content="{{strategyDetailObj.content}}"></mp-html>
</view>
\ No newline at end of file
.strategy-detail-box {
height: 100vh;
background: #FFFFFF;
padding: 30rpx 40rpx;
box-sizing: border-box;
height: 100vh;
background: #ffffff;
padding: 30rpx 40rpx;
box-sizing: border-box;
}
.strategy-detail-title {
font-weight: 600;
font-size: 48rpx;
color: #333333;
letter-spacing: 2rpx;
font-weight: 600;
font-size: 48rpx;
color: #333333;
letter-spacing: 2rpx;
}
.strategy-detail-view {
font-weight: 400;
font-size: 32rpx;
color: #999999;
font-weight: 400;
font-size: 32rpx;
color: #999999;
margin-top: 24rpx;
}
.strategy-img {
width: 670rpx;
height: 376rpx;
border-radius: 16rpx;
-webkit-border-radius: 16rpx;
-moz-border-radius: 16rpx;
-ms-border-radius: 16rpx;
-o-border-radius: 16rpx;
}
\ No newline at end of file
width: 670rpx;
height: 376rpx;
border-radius: 16rpx;
padding: 42rpx 0;
-webkit-border-radius: 16rpx;
-moz-border-radius: 16rpx;
-ms-border-radius: 16rpx;
-o-border-radius: 16rpx;
}
......@@ -51,6 +51,7 @@ class Storage {
* @param {*} syncFlag | 同步状态,默认 false (异步),true 为同步
*/
get = (key, syncFlag = true) => {
console.log(key, '====');
// 有值默认取key值
if (key) {
// 判断值是否是指定的对象值
......
......@@ -13,6 +13,9 @@ export const STORAGE_OBJECTkEY = {
unauthorized:'unauthorized',
wx_user_info:'wx_user_info',
srcm_shopmall_brand_list: 'srcm_shopmall_brand_list',
scrm_shopmall_staff_uuid: 'scrm_shopmall_staff_uuid',
srcm_shopmall_merchant_id: 'srcm_shopmall_merchant_id',
guest_no: 'guest_no'
}
export default{
......
......@@ -5,7 +5,8 @@ import mapApi from '../mapapi/mapapi'
import api from '~/api/request/http'
import { getUserInfo } from '~/utils/cache/userInfo'
// 实例化对象存储
import { Storage } from '~/utils/cache/storage'
// import { Storage } from '~/utils/cache/storage'
import Storage from '~/utils/cache/storage'
const $Storage = new Storage()
let TRACK_TIME = null,
......@@ -188,4 +189,4 @@ class TRACK {
}
}
wx.$Track = new TRACK()
export default TRACK
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!