更新了微信小程序获取头像和昵称的接口,修复了ios付款后订阅消息一闪而过的bug,还有其他一些小问题。
This commit is contained in:
parent
eed38ed482
commit
353cad572e
@ -1,5 +1,6 @@
|
|||||||
// const ApiRootUrl = 'http://localhost:8360/api/';
|
// const ApiRootUrl = 'http://localhost:8360/api/';
|
||||||
const ApiRootUrl = 'https://www.hiolabs.com/api/';
|
// const ApiRootUrl = 'http://192.168.0.108:8360/api/';
|
||||||
|
const ApiRootUrl = 'https://www.guxiaoling.com:8466/api/';
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// 登录
|
// 登录
|
||||||
|
|||||||
BIN
images/icon/addr-line.png
Normal file
BIN
images/icon/addr-line.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
@ -27,7 +27,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template name="wxParseImg">
|
<template name="wxParseImg">
|
||||||
<image class="{{item.classStr}} wxParse-{{item.tag}}" data-from="{{item.from}}" data-src="{{item.attr.src}}" data-idx="{{item.imgIndex}}" src="{{item.attr.src}}" mode="aspectFit" bindload="wxParseImgLoad" bindtap="wxParseImgTap" style="width:{{item.width}}px;height:{{item.height}}px;{{item.attr.style}}" />
|
<image class="{{item.classStr}} wxParse-{{item.tag}}" data-from="{{item.from}}" data-src="{{item.attr.src}}" data-idx="{{item.imgIndex}}" src="{{item.attr.src}}" mode="widthFix" bindload="wxParseImgLoad" bindtap="wxParseImgTap" style="width:{{item.width}}px;height:{{item.height}}px;{{item.attr.style}}" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template name="WxEmojiView">
|
<template name="WxEmojiView">
|
||||||
|
|||||||
@ -6,10 +6,10 @@ const app = getApp()
|
|||||||
|
|
||||||
Page({
|
Page({
|
||||||
data: {
|
data: {
|
||||||
|
|
||||||
},
|
},
|
||||||
onLoad: function (options) {
|
onLoad: function (options) {
|
||||||
|
|
||||||
},
|
},
|
||||||
onShow: function () {
|
onShow: function () {
|
||||||
let userInfo = wx.getStorageSync('userInfo');
|
let userInfo = wx.getStorageSync('userInfo');
|
||||||
@ -17,23 +17,78 @@ Page({
|
|||||||
wx.navigateBack();
|
wx.navigateBack();
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
getUserInfo: function (e) {
|
// getUserInfo: function (e) {
|
||||||
app.globalData.userInfo = e.detail.userInfo
|
// app.globalData.userInfo = e.detail.userInfo
|
||||||
user.loginByWeixin().then(res => {
|
// user.loginByWeixin().then(res => {
|
||||||
app.globalData.userInfo = res.data.userInfo;
|
// app.globalData.userInfo = res.data.userInfo;
|
||||||
app.globalData.token = res.data.token;
|
// app.globalData.token = res.data.token;
|
||||||
let is_new = res.data.is_new;//服务器返回的数据;
|
// let is_new = res.data.is_new;//服务器返回的数据;
|
||||||
if (is_new == 0) {
|
// if (is_new == 0) {
|
||||||
util.showErrorToast('您已经是老用户啦!');
|
// util.showErrorToast('您已经是老用户啦!');
|
||||||
wx.navigateBack();
|
// wx.navigateBack();
|
||||||
}
|
// }
|
||||||
else if (is_new == 1) {
|
// else if (is_new == 1) {
|
||||||
wx.navigateBack();
|
// wx.navigateBack();
|
||||||
}
|
// }
|
||||||
|
|
||||||
}).catch((err) => { });
|
// }).catch((err) => { });
|
||||||
|
// },
|
||||||
|
|
||||||
|
getUserProfile: function () {
|
||||||
|
// wx.navigateTo({
|
||||||
|
// url: '/pages/app-auth/index',
|
||||||
|
// });
|
||||||
|
let that = this;
|
||||||
|
let code = '';
|
||||||
|
wx.login({
|
||||||
|
success: (res) => {
|
||||||
|
code = res.code;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
// 获取用户信息
|
||||||
|
wx.getUserProfile({
|
||||||
|
lang: 'zh_CN',
|
||||||
|
desc: '用户登录',
|
||||||
|
success: (res) => {
|
||||||
|
let loginParams = {
|
||||||
|
code: code,
|
||||||
|
encryptedData: res.encryptedData,
|
||||||
|
iv: res.iv,
|
||||||
|
rawData: res.rawData,
|
||||||
|
signature: res.signature
|
||||||
|
};
|
||||||
|
console.log(loginParams);
|
||||||
|
that.postLogin(loginParams);
|
||||||
|
},
|
||||||
|
// 失败回调
|
||||||
|
fail: () => {
|
||||||
|
// 弹出错误
|
||||||
|
App.showError('已拒绝小程序获取信息');
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
goBack:function(){
|
postLogin(info) {
|
||||||
|
util.request(api.AuthLoginByWeixin, {
|
||||||
|
info: info
|
||||||
|
}, 'POST').then(function (res) {
|
||||||
|
console.log(res);
|
||||||
|
if (res.errno === 0) {
|
||||||
|
wx.setStorageSync('userInfo', res.data.userInfo);
|
||||||
|
wx.setStorageSync('token', res.data.token);
|
||||||
|
app.globalData.userInfo = res.data.userInfo;
|
||||||
|
app.globalData.token = res.data.token;
|
||||||
|
let is_new = res.data.is_new; //服务器返回的数据;
|
||||||
|
console.log(is_new);
|
||||||
|
if (is_new == 0) {
|
||||||
|
util.showErrorToast('您已经是老用户啦!');
|
||||||
|
wx.navigateBack();
|
||||||
|
} else if (is_new == 1) {
|
||||||
|
wx.navigateBack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
goBack: function () {
|
||||||
wx.navigateBack();
|
wx.navigateBack();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -5,9 +5,14 @@
|
|||||||
<view class='logo-name'>海风小店</view>
|
<view class='logo-name'>海风小店</view>
|
||||||
<view class='intro'>开源微信小程序商城</view>
|
<view class='intro'>开源微信小程序商城</view>
|
||||||
<view class='login'>请完成微信授权以继续使用</view>
|
<view class='login'>请完成微信授权以继续使用</view>
|
||||||
<button class='btn-login' open-type="getUserInfo" bindgetuserinfo='getUserInfo'>
|
<!-- <button class='btn-login' open-type="getUserInfo" bindgetuserinfo='getUserInfo'>
|
||||||
<image src='/images/icon/weixin-w.png' class='img-w'></image>
|
<image src='/images/icon/weixin-w.png' class='img-w'></image>
|
||||||
<view class='text'>微信快捷登录</view>
|
<view class='text'>微信快捷登录</view>
|
||||||
|
</button> -->
|
||||||
|
<button class='btn-login' bindtap='getUserProfile'>
|
||||||
|
<view class='img-w'></view>
|
||||||
|
<view class='text'>微信快捷登录</view>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<view class="cancel" bindtap="goBack">取消</view>
|
<view class="cancel" bindtap="goBack">取消</view>
|
||||||
</view>
|
</view>
|
||||||
@ -30,6 +30,15 @@ Page({
|
|||||||
this.getCartList();
|
this.getCartList();
|
||||||
this.getCartNum();
|
this.getCartNum();
|
||||||
wx.removeStorageSync('categoryId');
|
wx.removeStorageSync('categoryId');
|
||||||
|
},
|
||||||
|
goGoodsDetail(e){
|
||||||
|
let goodsId = e.currentTarget.dataset.goodsid;
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/goods/goods?id='+goodsId,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
nothing:function(){
|
||||||
|
|
||||||
},
|
},
|
||||||
onPullDownRefresh: function() {
|
onPullDownRefresh: function() {
|
||||||
wx.showNavigationBarLoading()
|
wx.showNavigationBarLoading()
|
||||||
|
|||||||
@ -8,8 +8,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<image src="/images/icon/gou-gray.png" wx:else class="checkbox"></image>
|
<image src="/images/icon/gou-gray.png" wx:else class="checkbox"></image>
|
||||||
<view class="goods-info">
|
<view class="goods-info">
|
||||||
<navigator class="goods-url" hover-class="none" url="/pages/goods/goods?id={{item.goods_id}}">
|
<view class="goods-url">
|
||||||
<view class="img-box">
|
<view class="img-box" bindtap="goGoodsDetail" data-goodsid="{{item.goods_id}}">
|
||||||
<image src="{{item.list_pic_url}}" class="img" />
|
<image src="{{item.list_pic_url}}" class="img" />
|
||||||
</view>
|
</view>
|
||||||
<view class="text-box">
|
<view class="text-box">
|
||||||
@ -18,14 +18,14 @@
|
|||||||
<view class="goods-price">
|
<view class="goods-price">
|
||||||
<view class='price-now'>¥{{item.retail_price}}</view>
|
<view class='price-now'>¥{{item.retail_price}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="selnum" wx:if="{{item.number > 0 && item.is_on_sale == 1}}">
|
<view class="selnum" catchtap="nothing" wx:if="{{item.number > 0 && item.is_on_sale == 1}}">
|
||||||
<view data-item-index="{{index}}" class="cut" catchtap="cutNumber">-</view>
|
<view data-item-index="{{index}}" class="cut" catchtap="cutNumber">-</view>
|
||||||
<input value="{{item.number}}" class="number" disabled="true" type="number" />
|
<input value="{{item.number}}" class="number" disabled="true" type="number" />
|
||||||
<view data-item-index="{{index}}" class="add" catchtap="addNumber" disabled='{{disabled}}'>+</view>
|
<view data-item-index="{{index}}" class="add" catchtap="addNumber" disabled='{{disabled}}'>+</view>
|
||||||
</view>
|
</view>
|
||||||
<view wx:else class="out-stock">暂时缺货</view>
|
<view wx:else class="out-stock">暂时缺货</view>
|
||||||
</view>
|
</view>
|
||||||
</navigator>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="delete-btn" data-item-index="{{index}}" catchtap="deleteGoods">
|
<view class="delete-btn" data-item-index="{{index}}" catchtap="deleteGoods">
|
||||||
|
|||||||
@ -231,7 +231,7 @@ button::after {
|
|||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-info .text-box .selnum {
|
/* .goods-info .text-box .selnum {
|
||||||
width: 146rpx;
|
width: 146rpx;
|
||||||
height: 52rpx;
|
height: 52rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -240,8 +240,21 @@ button::after {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
right: 30rpx;
|
right: 30rpx;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
} */
|
||||||
|
|
||||||
|
.goods-info .text-box .selnum {
|
||||||
|
width: 146rpx;
|
||||||
|
height: 52rpx;
|
||||||
|
padding: 50rpx 0 0 100rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
align-items: center;
|
||||||
|
position: absolute;
|
||||||
|
right: 30rpx;
|
||||||
|
bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.selnum .cut {
|
.selnum .cut {
|
||||||
width: 46rpx;
|
width: 46rpx;
|
||||||
height: 46rpx;
|
height: 46rpx;
|
||||||
@ -345,7 +358,6 @@ button::after {
|
|||||||
width: 510rpx;
|
width: 510rpx;
|
||||||
/* justify-content: space-between; */
|
/* justify-content: space-between; */
|
||||||
line-height: 100rpx;
|
line-height: 100rpx;
|
||||||
padding: 0 30rpx 0 0;
|
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
@ -367,5 +379,5 @@ button::after {
|
|||||||
.settle-box .total {
|
.settle-box .total {
|
||||||
color: #ff3456;
|
color: #ff3456;
|
||||||
float: left;
|
float: left;
|
||||||
margin-left: 30rpx;
|
margin-left: 20rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -125,7 +125,9 @@ Page({
|
|||||||
galleryImages: galleryImages,
|
galleryImages: galleryImages,
|
||||||
loading:1
|
loading:1
|
||||||
});
|
});
|
||||||
WxParse.wxParse('goodsDetail', 'html', res.data.info.goods_desc, that);
|
setTimeout(() => {
|
||||||
|
WxParse.wxParse('goodsDetail', 'html', res.data.info.goods_desc, that);
|
||||||
|
}, 1000);
|
||||||
wx.setStorageSync('goodsImage', res.data.info.https_pic_url);
|
wx.setStorageSync('goodsImage', res.data.info.https_pic_url);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -392,7 +394,6 @@ Page({
|
|||||||
alone_text: '加入购物车'
|
alone_text: '加入购物车'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
//提示选择完整规格
|
//提示选择完整规格
|
||||||
if (!this.isCheckedAllSpec()) {
|
if (!this.isCheckedAllSpec()) {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
@ -401,7 +402,6 @@ Page({
|
|||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//根据选中的规格,判断是否有对应的sku信息
|
//根据选中的规格,判断是否有对应的sku信息
|
||||||
let checkedProductArray = this.getCheckedProductItem(this.getCheckedSpecKey());
|
let checkedProductArray = this.getCheckedProductItem(this.getCheckedSpecKey());
|
||||||
if (!checkedProductArray || checkedProductArray.length <= 0) {
|
if (!checkedProductArray || checkedProductArray.length <= 0) {
|
||||||
@ -422,6 +422,10 @@ Page({
|
|||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
wx.showLoading({
|
||||||
|
title: '',
|
||||||
|
mask:true
|
||||||
|
})
|
||||||
util.request(api.CartAdd, {
|
util.request(api.CartAdd, {
|
||||||
addType: 0,
|
addType: 0,
|
||||||
goodsId: this.data.id,
|
goodsId: this.data.id,
|
||||||
@ -450,7 +454,7 @@ Page({
|
|||||||
title: _res.errmsg,
|
title: _res.errmsg,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
wx.hideLoading()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -500,6 +504,10 @@ Page({
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//添加到购物车
|
//添加到购物车
|
||||||
|
wx.showLoading({
|
||||||
|
title: '',
|
||||||
|
mask:true
|
||||||
|
})
|
||||||
util.request(api.CartAdd, {
|
util.request(api.CartAdd, {
|
||||||
addType: 1, // 0:正常加入购物车,1:立即购买,2:再来一单
|
addType: 1, // 0:正常加入购物车,1:立即购买,2:再来一单
|
||||||
goodsId: this.data.id,
|
goodsId: this.data.id,
|
||||||
@ -508,6 +516,7 @@ Page({
|
|||||||
}, "POST")
|
}, "POST")
|
||||||
.then(function(res) {
|
.then(function(res) {
|
||||||
let _res = res;
|
let _res = res;
|
||||||
|
wx.hideLoading()
|
||||||
if (_res.errno == 0) {
|
if (_res.errno == 0) {
|
||||||
let id = that.data.id;
|
let id = that.data.id;
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
|
|||||||
@ -55,6 +55,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class='details-wrap'>
|
<view class='details-wrap'>
|
||||||
<view class="title">商品详情</view>
|
<view class="title">商品详情</view>
|
||||||
|
<!-- <ad unit-id="adunit-2d961509e15e91d7" ad-type="grid" grid-opacity="0.8" grid-count="5" ad-theme="white"></ad> -->
|
||||||
<view class="show">
|
<view class="show">
|
||||||
<view class='details-image-wrap'>
|
<view class='details-image-wrap'>
|
||||||
<import src="../../lib/wxParse/wxParse.wxml" />
|
<import src="../../lib/wxParse/wxParse.wxml" />
|
||||||
|
|||||||
@ -14,7 +14,9 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ad-video{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
.loading {
|
.loading {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@ -12,14 +12,27 @@ Page({
|
|||||||
showChannel: 0,
|
showChannel: 0,
|
||||||
showBanner: 0,
|
showBanner: 0,
|
||||||
showBannerImg: 0,
|
showBannerImg: 0,
|
||||||
goodsCount: 0,
|
|
||||||
banner: [],
|
banner: [],
|
||||||
index_banner_img: 0,
|
index_banner_img: 0,
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
imgurl: '',
|
imgurl: '',
|
||||||
sysHeight: 0,
|
sysHeight: 0,
|
||||||
loading: 0,
|
loading: 0,
|
||||||
autoplay:true
|
autoplay:true,
|
||||||
|
showContact:1,
|
||||||
|
},
|
||||||
|
onPageScroll: function (e) {
|
||||||
|
let scrollTop = e.scrollTop;
|
||||||
|
let that = this;
|
||||||
|
if (scrollTop >= 2000) {
|
||||||
|
that.setData({
|
||||||
|
showContact: 0
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
that.setData({
|
||||||
|
showContact: 1
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onHide:function(){
|
onHide:function(){
|
||||||
this.setData({
|
this.setData({
|
||||||
@ -38,14 +51,6 @@ Page({
|
|||||||
url: '/pages/category/index',
|
url: '/pages/category/index',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCatalog: function () {
|
|
||||||
let that = this;
|
|
||||||
util.request(api.GoodsCount).then(function (res) {
|
|
||||||
that.setData({
|
|
||||||
goodsCount: res.data.goodsCount
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleTap: function (event) {
|
handleTap: function (event) {
|
||||||
//阻止冒泡
|
//阻止冒泡
|
||||||
},
|
},
|
||||||
@ -73,17 +78,25 @@ Page({
|
|||||||
notice: res.data.notice,
|
notice: res.data.notice,
|
||||||
loading: 1,
|
loading: 1,
|
||||||
});
|
});
|
||||||
|
let cartGoodsCount = '';
|
||||||
|
if (res.data.cartCount == 0) {
|
||||||
|
wx.removeTabBarBadge({
|
||||||
|
index: 2,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
cartGoodsCount = res.data.cartCount + '';
|
||||||
|
wx.setTabBarBadge({
|
||||||
|
index: 2,
|
||||||
|
text: cartGoodsCount
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onLoad: function (options) {
|
onLoad: function (options) {
|
||||||
let systemInfo = wx.getStorageSync('systemInfo');
|
this.getChannelShowInfo();
|
||||||
var scene = decodeURIComponent(options.scene);
|
|
||||||
this.getCatalog();
|
|
||||||
},
|
},
|
||||||
onShow: function () {
|
onShow: function () {
|
||||||
this.getCartNum();
|
|
||||||
this.getChannelShowInfo();
|
|
||||||
this.getIndexData();
|
this.getIndexData();
|
||||||
var that = this;
|
var that = this;
|
||||||
let userInfo = wx.getStorageSync('userInfo');
|
let userInfo = wx.getStorageSync('userInfo');
|
||||||
@ -100,24 +113,6 @@ Page({
|
|||||||
});
|
});
|
||||||
wx.removeStorageSync('categoryId');
|
wx.removeStorageSync('categoryId');
|
||||||
},
|
},
|
||||||
getCartNum: function () {
|
|
||||||
util.request(api.CartGoodsCount).then(function (res) {
|
|
||||||
if (res.errno === 0) {
|
|
||||||
let cartGoodsCount = '';
|
|
||||||
if (res.data.cartTotal.goodsCount == 0) {
|
|
||||||
wx.removeTabBarBadge({
|
|
||||||
index: 2,
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
cartGoodsCount = res.data.cartTotal.goodsCount + '';
|
|
||||||
wx.setTabBarBadge({
|
|
||||||
index: 2,
|
|
||||||
text: cartGoodsCount
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getChannelShowInfo: function (e) {
|
getChannelShowInfo: function (e) {
|
||||||
let that = this;
|
let that = this;
|
||||||
util.request(api.ShowSettings).then(function (res) {
|
util.request(api.ShowSettings).then(function (res) {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<view class="container" wx:if="{{loading == 1}}">
|
<view class="container" wx:if="{{loading == 1}}">
|
||||||
<view class='contact-wrap'>
|
<view class='contact-wrap' wx:if="{{showContact == 1}}">
|
||||||
<button class="contact-btn" session-from='{"nickName":"{{userInfo.nickname}}","avatarUrl":"{{userInfo.avatar}}"}' open-type="contact">
|
<button class="contact-btn" session-from='{"nickName":"{{userInfo.nickname}}","avatarUrl":"{{userInfo.avatar}}"}' open-type="contact">
|
||||||
<image class='icon' src='/images/icon/contact.png'></image>
|
<image class='icon' src='/images/icon/contact.png'></image>
|
||||||
<view class='text'>客服</view>
|
<view class='text'>客服</view>
|
||||||
@ -7,7 +7,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="search" bindtap="goSearch">
|
<view class="search" bindtap="goSearch">
|
||||||
<image class="icon" src="/images/icon/search.png"></image>
|
<image class="icon" src="/images/icon/search.png"></image>
|
||||||
<text class="txt">搜索, 共{{goodsCount}}款好物</text>
|
<text class="txt">搜索,发现更多好物</text>
|
||||||
</view>
|
</view>
|
||||||
<view class='banner-wrap' wx:if="{{show_banner && banner.length > 0}}">
|
<view class='banner-wrap' wx:if="{{show_banner && banner.length > 0}}">
|
||||||
<swiper class="banner" indicator-dots="true" autoplay="{{autoplay}}" interval="3000" duration="1000" >
|
<swiper class="banner" indicator-dots="true" autoplay="{{autoplay}}" interval="3000" duration="1000" >
|
||||||
@ -34,6 +34,7 @@
|
|||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- <ad unit-id="adunit-c755904541658aa1" ad-type="grid" grid-opacity="0.8" grid-count="5" ad-theme="white"></ad> -->
|
||||||
<swiper class="catalog-wrap" indicator-dots="{{false}}" indicator-color="#dedede" indicator-active-color="#e00000" wx:if="{{show_channel}}">
|
<swiper class="catalog-wrap" indicator-dots="{{false}}" indicator-color="#dedede" indicator-active-color="#e00000" wx:if="{{show_channel}}">
|
||||||
<swiper-item class="first">
|
<swiper-item class="first">
|
||||||
<view wx:for="{{channel}}" wx:if="{{item.sort_order < 7}}" wx:key="id" class='icon-navi' data-cateid="{{item.id}}" bindtap="goCategory">
|
<view wx:for="{{channel}}" wx:if="{{item.sort_order < 7}}" wx:key="id" class='icon-navi' data-cateid="{{item.id}}" bindtap="goCategory">
|
||||||
@ -95,6 +96,7 @@
|
|||||||
<view class="more-category" data-cateid="{{item.id}}" bindtap="goCategory">点击查看更多{{item.name}}</view>
|
<view class="more-category" data-cateid="{{item.id}}" bindtap="goCategory">点击查看更多{{item.name}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- <ad unit-id="adunit-b6fcdb43b7913591"></ad> -->
|
||||||
<view class="no-more-goods ">没有更多商品啦</view>
|
<view class="no-more-goods ">没有更多商品啦</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="loading" style="height:{{sysHeight}}px" wx:else>
|
<view class="loading" style="height:{{sysHeight}}px" wx:else>
|
||||||
|
|||||||
@ -25,4 +25,5 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class='btn-go-order' bindtap="toOrderListPage">返回我的页面</view>
|
<view class='btn-go-order' bindtap="toOrderListPage">返回我的页面</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- <ad unit-id="adunit-f572025851df64b3" ad-type="video" ad-theme="white"></ad> -->
|
||||||
</view>
|
</view>
|
||||||
@ -24,9 +24,21 @@ Page({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
toIndex: function() {
|
toIndex: function() {
|
||||||
wx.switchTab({
|
wx.requestSubscribeMessage({
|
||||||
url: '/pages/index/index'
|
tmplIds: ['w6AMCJ0FI2LqjCjWPIrpnVWTsFgnlNlmCf9TTDmG6_U'],
|
||||||
});
|
success(res) {
|
||||||
|
console.log(res);
|
||||||
|
wx.switchTab({
|
||||||
|
url: '/pages/index/index'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
console.log(err);
|
||||||
|
wx.switchTab({
|
||||||
|
url: '/pages/index/index'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
payOrder() {
|
payOrder() {
|
||||||
pay.payOrder(parseInt(this.data.orderId)).then(res => {
|
pay.payOrder(parseInt(this.data.orderId)).then(res => {
|
||||||
|
|||||||
@ -28,4 +28,5 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class='btn-go-order' bindtap="toOrderListPage">返回我的页面</view>
|
<view class='btn-go-order' bindtap="toOrderListPage">返回我的页面</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- <ad class="ad-video" unit-id="adunit-f572025851df64b3" ad-type="video" ad-theme="white"></ad> -->
|
||||||
</view>
|
</view>
|
||||||
@ -8,7 +8,9 @@ page {
|
|||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
.ad-video{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
.result-wrap {
|
.result-wrap {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 40%;
|
height: 40%;
|
||||||
|
|||||||
@ -12,4 +12,5 @@
|
|||||||
更多信息访问:hiolabs.com
|
更多信息访问:hiolabs.com
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- <ad unit-id="adunit-1776b4f8f2217197" ad-type="video" ad-theme="white"></ad> -->
|
||||||
</view>
|
</view>
|
||||||
@ -24,6 +24,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- <ad unit-id="adunit-89ae0a0b6860dc9f" ad-type="grid" grid-opacity="0.8" grid-count="5" ad-theme="white"></ad> -->
|
||||||
<view class="order-container">
|
<view class="order-container">
|
||||||
<view class='header' data-index='0' bindtap='toOrderListTap'>
|
<view class='header' data-index='0' bindtap='toOrderListTap'>
|
||||||
<view class='top-title'>
|
<view class='top-title'>
|
||||||
@ -103,7 +104,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="company">
|
<view class="company">
|
||||||
<view class="c-wrap">
|
<view class="c-wrap" bindtap="getOrderInfo">
|
||||||
<view class="text">海风小店</view>
|
<view class="text">海风小店</view>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -19,15 +19,6 @@ function payOrder(orderId) {
|
|||||||
'signType': payParam.signType,
|
'signType': payParam.signType,
|
||||||
'paySign': payParam.paySign,
|
'paySign': payParam.paySign,
|
||||||
'success': function(res) {
|
'success': function(res) {
|
||||||
wx.requestSubscribeMessage({
|
|
||||||
tmplIds: ['w6AMCJ0FI2LqjCjWPIrpnVWTsFgnlNlmCf9TTDmG6_U'],
|
|
||||||
success(res) {
|
|
||||||
console.log(res);
|
|
||||||
},
|
|
||||||
fail(err) {
|
|
||||||
console.log(err);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
resolve(res);
|
resolve(res);
|
||||||
},
|
},
|
||||||
'fail': function(res) {
|
'fail': function(res) {
|
||||||
|
|||||||
@ -74,7 +74,7 @@ function request(url, data = {}, method = "GET") {
|
|||||||
method: method,
|
method: method,
|
||||||
header: {
|
header: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'X-Nideshop-Token': wx.getStorageSync('token')
|
'X-Hioshop-Token': wx.getStorageSync('token')
|
||||||
},
|
},
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
if (res.statusCode == 200) {
|
if (res.statusCode == 200) {
|
||||||
@ -82,30 +82,30 @@ function request(url, data = {}, method = "GET") {
|
|||||||
if (res.data.errno == 401) {
|
if (res.data.errno == 401) {
|
||||||
//需要登录后才可以操作
|
//需要登录后才可以操作
|
||||||
|
|
||||||
let code = null;
|
// let code = null;
|
||||||
return login().then((res) => {
|
// return login().then((res) => {
|
||||||
code = res.code;
|
// code = res.code;
|
||||||
return getUserInfo();
|
// return getUserInfo();
|
||||||
}).then((userInfo) => {
|
// }).then((userInfo) => {
|
||||||
//登录远程服务器
|
// //登录远程服务器
|
||||||
request(api.AuthLoginByWeixin, {
|
// request(api.AuthLoginByWeixin, {
|
||||||
code: code,
|
// code: code,
|
||||||
userInfo: userInfo
|
// userInfo: userInfo
|
||||||
}, 'POST').then(res => {
|
// }, 'POST').then(res => {
|
||||||
if (res.errno === 0) {
|
// if (res.errno === 0) {
|
||||||
//存储用户信息
|
// //存储用户信息
|
||||||
wx.setStorageSync('userInfo', res.data.userInfo);
|
// wx.setStorageSync('userInfo', res.data.userInfo);
|
||||||
wx.setStorageSync('token', res.data.token);
|
// wx.setStorageSync('token', res.data.token);
|
||||||
resolve(res);
|
// resolve(res);
|
||||||
} else {
|
// } else {
|
||||||
reject(res);
|
// reject(res);
|
||||||
}
|
// }
|
||||||
}).catch((err) => {
|
// }).catch((err) => {
|
||||||
reject(err);
|
// reject(err);
|
||||||
});
|
// });
|
||||||
}).catch((err) => {
|
// }).catch((err) => {
|
||||||
reject(err);
|
// reject(err);
|
||||||
})
|
// })
|
||||||
} else {
|
} else {
|
||||||
resolve(res.data);
|
resolve(res.data);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user