Authored by yyq

yas pvid

... ... @@ -4,8 +4,8 @@ import Yas from '../../common/yas';
import {getVerifyCode, bindMobileAction} from '../../common/login';
let app = getApp();
let yas = new Yas();
let router = global.router;
let yas;
Page({
data: {
... ... @@ -26,6 +26,8 @@ Page({
onLoad: function(query) {
const {phone, area} = query || {};
yas = new Yas(app);
if (+area === 86 && phone) {
this.setData({
phoneNum: phone,
... ... @@ -47,6 +49,7 @@ Page({
this.setData({
hasUnionID: !!app.globalData.unionID
});
yas.pageOpenReport();
},
phoneInput: function(e) {
... ...
... ... @@ -3,9 +3,8 @@ import Yas from '../../common/yas';
import event from '../../common/event';
import accountModel from '../../models/account/index';
const yas = new Yas();
const AREA_CACHE_KEY = 'area_cache_key';
let yas;
Page({
data: {
... ... @@ -53,6 +52,8 @@ Page({
},
onLoad: function() {
this.getArea();
yas = new Yas();
yas.pageOpenReport();
}
});
\ No newline at end of file
});
... ...
... ... @@ -16,7 +16,7 @@ const ORDER_TYPE = { // 结算订单类型
const router = global.router;
const app = getApp();
const yas = new Yas(app);
let yas;
function formatPaymentData(data, yasInfo) {
data = data || {};
... ... @@ -110,6 +110,7 @@ Page({
};
this.loadEnsurePayment({buyNumber: this.orderData.buyNumber, productSku: this.orderData.productSku});
yas = new Yas(app);
yas.pageOpenReport();
},
loadEnsurePayment(options, reload) {
... ...
import Yas from '../../../common/yas';
const yas = new Yas();
let yas;
Page({
data: {
... ... @@ -22,6 +22,8 @@ Page({
wx.removeStorage({key: options.skey});
});
yas = new Yas();
yas.pageOpenReport();
},
tryToDo(fn) {
... ...
... ... @@ -8,7 +8,7 @@ const AREA_CACHE_KEY = 'address_provinces_cache';
let CACHE_AREA_LIST = {};
const yas = new Yas();
let yas;
const validateAddress = function(data) {
const errorTip = {
... ... @@ -92,6 +92,8 @@ Page({
this.loadAddrList();
yas = new Yas();
yas.pageOpenReport();
},
loadAddrList() {
... ...
... ... @@ -7,8 +7,8 @@ import {tapToLogin, getPhoneNumber} from '../../common/login';
//获取应用实例
let app = getApp();
let yas = new Yas();
let router = global.router;
let yas;
Page({
data: {
... ... @@ -40,6 +40,8 @@ Page({
this.getInfoNum();
this.chooseForYouList();
yas = new Yas(app);
yas.pageOpenReport();
},
onShow: function () {
... ...
... ... @@ -6,7 +6,7 @@ import Yas from '../../../common/yas';
const router = global.router;
let app = getApp();
const yas = new Yas(app);
let yas;
Page({
data: {
... ... @@ -20,6 +20,7 @@ Page({
this.loadOrderDetail(options.orderCode);
yas = new Yas(app);
yas.pageOpenReport();
},
loadOrderDetail(orderCode) {
... ...
... ... @@ -3,13 +3,13 @@ import Yas from '../../../../common/yas';
import orderModel from '../../../../models/home/order';
let app = getApp();
const yas = new Yas();
const windowHeights = app.globalData.systemInfo.windowHeight;
const windowWidth = app.globalData.systemInfo.windowWidth;
const pixelRatio = app.globalData.systemInfo.pixelRatio;
let sc = windowWidth * pixelRatio / 750;
let listH = parseInt((windowHeights * pixelRatio) / sc - 221) - 5;
let yas;
Page({
... ... @@ -33,8 +33,10 @@ Page({
});
this.expressDetail();
yas = new Yas(app);
yas.pageOpenReport();
},
copyExpressNo: function () {
wx.setClipboardData({data: this.data.orderID})
... ... @@ -80,4 +82,4 @@ Page({
}
});
}
});
\ No newline at end of file
});
... ...
... ... @@ -7,7 +7,7 @@ import formatImage from '../../../utils/formatImage';
//获取应用实例
let app = getApp();
let yas = new Yas();
let yas;
let {windowHeight} = app.getSystemInfo();
let timer;
... ... @@ -34,6 +34,7 @@ Page({
});
}
yas = new Yas(app);
yas.pageOpenReport();
},
startTimer: function () {
... ...
import Yas from '../../../common/yas';
const yas = new Yas();
let yas;
Page({
data: {},
... ... @@ -10,6 +10,7 @@ Page({
});
},
onLoad: function () {
yas = new Yas();
yas.pageOpenReport();
}
});
\ No newline at end of file
});
... ...
... ... @@ -5,7 +5,7 @@ import indexModel from '../../models/index/index';
//获取应用实例
let app = getApp();
let yas = new Yas();
let yas;
let router = global.router;
let {windowHeight} = app.getSystemInfo();
... ... @@ -18,7 +18,7 @@ Page({
resetListScrollPos: 0,
showLoading: false,
showNoMore: false,
isLoading: false,
currentPage: 1,
totalPage: 0,
... ... @@ -29,6 +29,8 @@ Page({
},
onLoad: function () {
this.productList({ page: 1, limit: 20});
yas = new Yas(app);
yas.pageOpenReport();
},
onReady: function () {
... ... @@ -80,7 +82,7 @@ Page({
query.selectViewport().scrollOffset();
query.exec(res => {
this.setData({
floatFilter: res[0].scrollTop > this.data.filterInitialTop - this.data.topSearchHeight
floatFilter: res[0].scrollTop > this.data.filterInitialTop - this.data.topSearchHeight
});
});
... ... @@ -94,7 +96,7 @@ Page({
sortChange: function (e) {
let params;
let {curSort, gender} = e.detail;
params = {
gender,
order: curSort,
... ... @@ -102,16 +104,16 @@ Page({
limit: 20
};
this.data.productList = [];
params.setScrollPos = true;
this.productList(params);
},
productList: function (params) {
if (this.data.isLoading) return;
this.data.isLoading = true;
wx.showLoading({title: '加载中'});
indexModel.productList(params).then(res => {
indexModel.productList(params).then(res => {
if (res.code === 200) {
const keyAdapter = {
skn: 'product_skn',
... ... @@ -125,7 +127,7 @@ Page({
let item = {};
Object.keys(keyAdapter).forEach(key => {
item[key] = product[keyAdapter[key]]
item[key] = product[keyAdapter[key]]
});
list.push(item);
});
... ... @@ -138,13 +140,13 @@ Page({
currentPage: params.page,
totalPage: res.data.page_total
});
if (!this.data.showCopyright) {
this.setData({
showCopyright: true
});
}
// 浮动筛选时滚动位置
if (this.data.floatFilter && params.setScrollPos) {
wx.pageScrollTo({
... ... @@ -152,7 +154,7 @@ Page({
duration: 10
});
}
if (this.data.pullRefresh) {
this.setData({
pullRefresh: false
... ... @@ -178,4 +180,4 @@ Page({
resourceClickReport: function (e) {
yas.report('YB_MAIN_EVENT', e.detail);
}
});
\ No newline at end of file
});
... ...
import Yas from '../../common/yas';
const yas = new Yas();
const router = global.router;
let yas;
Page({
data: {
... ... @@ -14,6 +14,7 @@ Page({
this.setData({orderPrice: options.price});
}
yas = new Yas();
yas.pageOpenReport();
},
viewOrderDetail() {
... ...
... ... @@ -2,11 +2,11 @@ import Yas from '../../../common/yas';
import categoryModel from '../../../models/product/category';
import shopModel from '../../../models/product/shop';
let app = getApp();
const yas = new Yas(app);
const app = getApp();
const router = global.router;
let yas;
Page({
data: {
scrollHeight: app.globalData.systemInfo.windowHeight - 120,
... ... @@ -22,6 +22,7 @@ Page({
this.loadCategoryList();
this.loadShopList();
yas = new Yas(app);
yas.pageOpenReport();
},
onShow: function () {
... ...
... ... @@ -11,10 +11,11 @@ import Picker from './picker/picker';
import {Actionsheet} from '../../../vendors/zanui/index';
let app = getApp();
let yas = new Yas();
let router = global.router;
let {windowHeight} = app.getSystemInfo();
let yas;
Page({
...Actionsheet,
data: {
... ... @@ -78,7 +79,7 @@ Page({
shopRecList: [],
preferList: [],
showBackTop: false,
showBottomTipView: false
},
... ... @@ -94,11 +95,13 @@ Page({
this.supportService();
this.productIntro();
this.preferList();
yas = new Yas(app);
yas.pageOpenReport();
},
onPageScroll: function ({scrollTop}) {
const show = scrollTop > windowHeight * 2;
if (show !== this.data.showBackTop) {
this.setData({
showBackTop: show
... ... @@ -399,7 +402,7 @@ Page({
},
chooseColor: function (event) {
let pickData = this.data.pickerData;
//先遍历将所有颜色、尺码置为未选中状态
pickData.view.goodsList && pickData.view.goodsList.map(item => {
item.selected = false;
... ... @@ -471,7 +474,7 @@ Page({
pickData.view.buyButtonEnable = false
}
this.setData({
pickerData: pickData,
selectedSKU: tempItem.storage_number > 0 ? tempItem.product_sku : 0,
... ... @@ -552,7 +555,7 @@ Page({
buyNumber = parseInt(buyNumber) + 1;
}
if (buyNumber >= this.data.storageNumber) {
pickerData.view.plusButtonEnable = false;
}
... ... @@ -570,7 +573,7 @@ Page({
title: '对不起,没有更多库存了',
icon: 'none',
duration: 1000
});
});
},
plusReachedLimitAction: function (n) {
... ... @@ -579,7 +582,7 @@ Page({
icon: 'none',
duration: 1000
});
},
minReachedLimitAction: function (n) {
... ... @@ -619,8 +622,8 @@ Page({
},
_dataReport: function () {
yas.report('YB_GDS_DT_BILL', {
PRD_SKN: this.data.productSkn,
RPD_SKU: this.data.selectedSKU,
PRD_SKN: this.data.productSkn,
RPD_SKU: this.data.selectedSKU,
PRD_ID: this.data.selectedProductId
});
}
... ...
... ... @@ -3,8 +3,8 @@ import Yas from '../../../common/yas';
import listModel from '../../../models/product/list';
import {parse} from '../../../vendors/query-stringify';
const yas = new Yas();
const {windowHeight} = getApp().getSystemInfo();
let yas;
Page({
data: {
... ... @@ -23,7 +23,7 @@ Page({
},
onLoad:function (options) {
let title = decodeURIComponent(options.title) || '默认标题';
delete options.title;
wx.setNavigationBarTitle({
title
... ... @@ -33,6 +33,8 @@ Page({
urlParams: options
});
this.productList(options);
yas = new Yas();
yas.pageOpenReport();
},
onPageScroll: function({scrollTop}) {
... ... @@ -91,7 +93,7 @@ Page({
currentPage: params.page,
totalPage: res.data.page_total,
showNoMore: params.page === res.data.page_total,
noResult: !this.data.productList.concat(list).length
noResult: !this.data.productList.concat(list).length
});
if (params.resetScroll) {
... ... @@ -110,8 +112,8 @@ Page({
this.data.order = curSort;
this.data.currentPage = 0;
this.data.totalPage = 1;
this.data.productList = [];
this.productList(Object.assign({resetScroll: true}, this.data.urlParams));
}
});
\ No newline at end of file
});
... ...
... ... @@ -5,11 +5,11 @@ import listModel from '../../../models/product/list';
import shopModel from '../../../models/product/shop';
import { Actionsheet } from '../../../vendors/zanui/index';
let app = getApp();
let yas = new Yas();
let { windowHeight } = app.getSystemInfo();
let yas;
Page({
...Actionsheet,
data: {
... ... @@ -54,6 +54,8 @@ Page({
this.shopInfo();
this.shopDecFloor();
this.productList({page: 1, limit: 20, shop_id: shopId});
yas = new Yas(app);
yas.pageOpenReport();
},
onReady: function () {
... ... @@ -121,7 +123,7 @@ Page({
currentPage: params.page,
totalPage: res.data.page_total
});
if (this.data.fixedFilter && params.resetScroll) {
wx.pageScrollTo({
scrollTop: this.data.shopInfoHeight,
... ...
... ... @@ -2,9 +2,10 @@ import wx from '../../../utils/wx';
import Yas from '../../../common/yas'
import searchModel from '../../../models/product/search';
const yas = new Yas();
const {windowHeight} = getApp().getSystemInfo();
let yas;
Page({
data: {
query: '',
... ... @@ -30,7 +31,7 @@ Page({
query: this.data.query,
order: this.data.order,
gender: this.data.gender,
page: this.data.currentPage + 1,
page: this.data.currentPage + 1,
limit: 20
});
} else {
... ... @@ -40,6 +41,7 @@ Page({
}
},
onLoad: function() {
yas = new Yas();
yas.pageOpenReport();
},
onPageScroll: function({scrollTop}) {
... ... @@ -66,7 +68,7 @@ Page({
},
confirmQuery: function (e) {
let query = e.detail.value.trim();
if (!query) {
return wx.showToast({
title: '请输入检索关键词',
... ... @@ -135,7 +137,7 @@ Page({
sortChange: function (e) {
let params;
let {curSort, gender} = e.detail;
this.data.gender = gender;
this.data.order = curSort;
... ... @@ -150,4 +152,4 @@ Page({
params.resetScroll = true;
this.productList(params);
}
});
\ No newline at end of file
});
... ...