|
@@ -5,7 +5,7 @@ import {
|
|
|
|
|
|
const app = getApp()
|
|
const app = getApp()
|
|
var utils = require('../../utils/util.js');
|
|
var utils = require('../../utils/util.js');
|
|
-let globalInterval = {};
|
|
|
|
|
|
+
|
|
Page({
|
|
Page({
|
|
data: {
|
|
data: {
|
|
currentTab: 0,
|
|
currentTab: 0,
|
|
@@ -21,20 +21,16 @@ Page({
|
|
|
|
|
|
|
|
|
|
onShow: async function () {
|
|
onShow: async function () {
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ // console.log(app.globalData.userInfo)
|
|
// var that = this;
|
|
// var that = this;
|
|
- // var mobile = wx.getStorageSync('mobile');
|
|
|
|
- // console.log(mobile + "/////////" );
|
|
|
|
- // if (!mobile) {
|
|
|
|
- // that.setData({
|
|
|
|
- // check_mobile: false
|
|
|
|
- // })
|
|
|
|
- // } else {
|
|
|
|
|
|
+ // let checkMobile = false;
|
|
|
|
+ // if(app.globalData.userInfo && app.globalData.userInfo.mobile){
|
|
|
|
+ // checkMobile = true;
|
|
|
|
+ // }
|
|
// that.setData({
|
|
// that.setData({
|
|
- // check_mobile: true
|
|
|
|
|
|
+ // check_mobile: checkMobile
|
|
// })
|
|
// })
|
|
- // }
|
|
|
|
|
|
+
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
@@ -90,7 +86,6 @@ Page({
|
|
let type = e.target.dataset.type;
|
|
let type = e.target.dataset.type;
|
|
// wx.showLoading({
|
|
// wx.showLoading({
|
|
// title: '加入购物车',
|
|
// title: '加入购物车',
|
|
- // mask: true
|
|
|
|
// });
|
|
// });
|
|
await this.updateCart(productId,type);
|
|
await this.updateCart(productId,type);
|
|
await this.getCart();
|
|
await this.getCart();
|
|
@@ -98,6 +93,7 @@ Page({
|
|
this.setData({showCart:false})
|
|
this.setData({showCart:false})
|
|
}
|
|
}
|
|
await this.initProduct();
|
|
await this.initProduct();
|
|
|
|
+ //动画
|
|
this.cartWwing();
|
|
this.cartWwing();
|
|
},
|
|
},
|
|
|
|
|
|
@@ -160,11 +156,11 @@ Page({
|
|
initProduct: function(){
|
|
initProduct: function(){
|
|
let series = this.data.series;
|
|
let series = this.data.series;
|
|
let productList = this.data.productList;
|
|
let productList = this.data.productList;
|
|
-
|
|
|
|
let cartList = this.data.cartList;
|
|
let cartList = this.data.cartList;
|
|
|
|
+ productList.forEach((ele,pindex) => {
|
|
|
|
+ ele.hasChoose = false;
|
|
|
|
+ ele.hasNum = 0;
|
|
cartList.forEach((ite,index) => {
|
|
cartList.forEach((ite,index) => {
|
|
- productList.forEach((ele,pindex) => {
|
|
|
|
- ele.hasChoose = false;
|
|
|
|
if (ele.id == ite.productId){
|
|
if (ele.id == ite.productId){
|
|
ele.hasChoose = true;
|
|
ele.hasChoose = true;
|
|
ele.hasNum = ite.num;
|
|
ele.hasNum = ite.num;
|