Commit 29f3deec by huahua

修改

parent ad6e9815
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
:background="'none'"></myhead> :background="'none'"></myhead>
<view style="position: relative;width: 100%; height: 100%; z-index: 2;"> <view style="position: relative;width: 100%; height: 100%; z-index: 2;">
<!-- 轮播图 --> <!-- 轮播图 -->
<view v-if="statusloading == 1" class='swiper-box' style="width: 100%; height: 100%;"> <view v-if="statusloading == 1" class='swiper-box' style="width: 100%; height: 100%;">
<swiper :autoplay="true" :interval="3000" :duration="1000" @change="swiperChange" <swiper :autoplay="true" :interval="3000" :duration="1000" @change="swiperChange"
...@@ -25,13 +24,13 @@ ...@@ -25,13 +24,13 @@
</view> </view>
</view> </view>
<view @click="Customize_now" hover-class="hover-class-bg" style="position: fixed; bottom: 100upx; left: 0; right: 0; margin: auto; <view @click="Customize_now" hover-class="hover-class-bg" style="position: fixed; bottom: 100upx; left: 0; right: 0; margin: auto;
width: 300upx; height: 100upx; width: 300upx; height: 100upx;
background: linear-gradient(92deg, #F29F3D, #67C4CA); background: linear-gradient(92deg, #F29F3D, #67C4CA);
box-shadow: 0px 19px 48px 1px rgba(20, 31, 62, 0.35); box-shadow: 0px 19px 48px 1px rgba(20, 31, 62, 0.35);
border-radius: 40px;"> border-radius: 40px;">
<view style=" text-align: center; line-height: 100upx; font-size: 36upx; font-weight: 500; color: #FFFFFF;"> <view
style=" text-align: center; line-height: 100upx; font-size: 36upx; font-weight: 500; color: #FFFFFF;">
立即定制</view> 立即定制</view>
</view> </view>
</view> </view>
...@@ -60,7 +59,7 @@ ...@@ -60,7 +59,7 @@
</view> </view>
<!-- 登录弹框 --> <!-- 登录弹框 -->
<Signin ref="Signin"></Signin> <Signin ref="Signin"></Signin>
<view v-if="statusloading == 1" @tap="toLineList" <view v-if="statusloading == 1" @tap="toLineList"
style="position: fixed; z-index: 99; right: 0; bottom: 200upx; width: 109upx; height: 123upx;"> style="position: fixed; z-index: 99; right: 0; bottom: 200upx; width: 109upx; height: 123upx;">
<image src="../../static/liebiao.png" mode="" style="width: 243upx; height: 123upx;"></image> <image src="../../static/liebiao.png" mode="" style="width: 243upx; height: 123upx;"></image>
...@@ -68,7 +67,6 @@ ...@@ -68,7 +67,6 @@
<switchGoods ref="switchGoods" @selectGoodItem="selectGoodItem"></switchGoods> <switchGoods ref="switchGoods" @selectGoodItem="selectGoodItem"></switchGoods>
<!--//商品弹框 --> <!--//商品弹框 -->
</view> </view>
</template> </template>
...@@ -104,26 +102,27 @@ ...@@ -104,26 +102,27 @@
goods: [], //商品列表 goods: [], //商品列表
currentIndex: 0, currentIndex: 0,
selectItem: null, //选择对象 selectItem: null, //选择对象
name: "",
}; };
}, },
methods: { methods: {
//去排队列表 //去排队列表
toLineList() { toLineList() {
if (!this.$AppContext.checkLogin()) { if (!this.$AppContext.checkLogin()) {
this.tologo() this.tologo(2)
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: '../mall/lineUp?machine_id='+this.machine_id+'&key=' + this.key url: '../mall/lineUp?machine_id=' + this.machine_id + '&key=' + this.key
}) })
} }
}, },
//选择商品进来 //选择商品进来
selectGoodItem(item) { selectGoodItem(item) {
uni.navigateTo({ uni.navigateTo({
url: '../index/index?machine_id='+this.machine_id+"&good_id=" +item.id, url: '../index/index?machine_id=' + this.machine_id + "&good_id=" + item.id,
}) })
}, },
...@@ -131,7 +130,7 @@ ...@@ -131,7 +130,7 @@
Customize_now() { Customize_now() {
let that = this; let that = this;
if (!this.$AppContext.checkLogin()) { if (!this.$AppContext.checkLogin()) {
this.tologo() this.tologo(1)
} else { } else {
this.$refs['switchGoods'].open(this.machine_id); this.$refs['switchGoods'].open(this.machine_id);
} }
...@@ -160,18 +159,26 @@ ...@@ -160,18 +159,26 @@
}, },
//授权登录 //授权登录
tologo() { tologo(type) {
// 先登陆 // 先登陆
let that = this; let that = this;
uni.login({ uni.login({
provider: 'weixin', provider: 'weixin',
success: (res) => { success: (res) => {
console.log(res)
//appcode: that.$Env.getappcode()
userService.login({ userService.login({
s: 'Init.init', s: 'Init.init',
code: res.code, code: res.code
appcode: that.$Env.getappcode()
}).then(r => { }).then(r => {
that.getDetail(); that.getDetail();
if (type == 1) {
that.$refs['switchGoods'].open(that.machine_id);
} else {
uni.navigateTo({
url: '../mall/lineUp?machine_id=' + that.machine_id + '&key=' + that.key
})
}
}).catch(err => { }).catch(err => {
that.$refs.Signin.init(); that.$refs.Signin.init();
}); });
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
//作品详情 //作品详情
Worksdetail(item) { Worksdetail(item) {
console.log(item) //console.log(item)
this.$emit('Worksdetail', item) this.$emit('Worksdetail', item)
}, },
...@@ -122,25 +122,6 @@ ...@@ -122,25 +122,6 @@
uni.hideLoading(); uni.hideLoading();
}); });
} }
/* uni.showLoading({
title: '正在加载中...',mask: true
})
homeservice.WorksList(this.queryPage).then(result => {
this.Material_categorydatalist = this.Material_categorydatalist.concat(result.data)
this.datalist = this.datalist.concat(result.data)
this.queryPage.page += 1;
if (Math.ceil(result.total / result.per_page) <= this.queryPage.page) {
return setTimeout(() => {
uni.showToast({title: '没有更多数据了!',icon: 'none'});
}, 500);
}
uni.hideLoading();
}).catch(err => {
uni.showToast({title: err.msg,icon: 'none'})
uni.hideLoading();
}); */
}, },
interrupt(e) { interrupt(e) {
...@@ -188,9 +169,8 @@ ...@@ -188,9 +169,8 @@
loadData =true; loadData =true;
} }
} */ } */
let loadData = true;
let loadData = false; /* if (item.e == 23 || item.e == 2) {
if (item.e == 23 || item.e == 2) {
if (this.queryPage.material_category_id != null && this.queryPage.material_category_id != "" && this if (this.queryPage.material_category_id != null && this.queryPage.material_category_id != "" && this
.queryPage.material_category_id != "null") { .queryPage.material_category_id != "null") {
if (this.queryPage.material_category_id == item.queryPage.material_category_id) { if (this.queryPage.material_category_id == item.queryPage.material_category_id) {
...@@ -212,11 +192,10 @@ ...@@ -212,11 +192,10 @@
if (this.datalist ==null || this.datalist.length <= 0) { if (this.datalist ==null || this.datalist.length <= 0) {
loadData = true; loadData = true;
} }
} } */
/*if (this.datalist ==null || this.datalist.length <= 0) {
if (this.datalist ==null || this.datalist.length <= 0) {
loadData = true; loadData = true;
} } */
this.queryPage = { this.queryPage = {
s: item.queryPage.s, s: item.queryPage.s,
...@@ -230,7 +209,7 @@ ...@@ -230,7 +209,7 @@
material_series_id: item.queryPage.material_series_id, //贴图壁纸选择值二级分类 material_series_id: item.queryPage.material_series_id, //贴图壁纸选择值二级分类
is_new: item.queryPage.is_new, //最新 is_new: item.queryPage.is_new, //最新
is_hot: item.queryPage.is_hot, //热门 is_hot: item.queryPage.is_hot, //热门
goods_id: item.queryPage.goods_id, //商品id goods_id: "", //商品id
is_under: item.queryPage.is_under, //贴图是否为背景图 is_under: item.queryPage.is_under, //贴图是否为背景图
partner_id: item.queryPage.partner_id //代理 partner_id: item.queryPage.partner_id //代理
} }
......
...@@ -10,11 +10,6 @@ ...@@ -10,11 +10,6 @@
你的第一份爱的定制在这里开始 你的第一份爱的定制在这里开始
</view> </view>
<view class="footer_but"> <view class="footer_but">
<!-- <button open-type="getUserInfo" @getuserinfo="getUserInfo" lang="zh_CN">
<image src="../../static/icon_wechat.png" mode="aspectFill"
style="width: 34upx; height: 30upx;"></image>
<text style="margin-left: 13upx;">微信一键登录</text>
</button> -->
<!-- 小程序登录、用户信息相关接口调整 --> <!-- 小程序登录、用户信息相关接口调整 -->
<button class="buttonGetUserInfo" hover-class="hover-class-bg" v-if="canIUseGetUserProfile" <button class="buttonGetUserInfo" hover-class="hover-class-bg" v-if="canIUseGetUserProfile"
@tap="getUserProfile"> @tap="getUserProfile">
...@@ -61,27 +56,21 @@ ...@@ -61,27 +56,21 @@
getUserProfile(e) { getUserProfile(e) {
uni.getSetting({ uni.getSetting({
success(res){ success(res){
console.log('获取用户信息是否用户同意')
console.log(res.authSetting)
console.log(res.authSetting['scope.userInfo'])
} }
}) })
let that = this; let that = this;
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认 //推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 //开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
wx.getUserProfile({ wx.getUserProfile({
lang:'zh_CN', lang:'zh_CN',
desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (Userres) => { success: (Userres) => {
console.log('getUserInfo 获取头像昵称')
console.log(Userres)
that.$base.Userres = Userres that.$base.Userres = Userres
uni.showLoading({title: '正在登录中...',mask: true}); uni.showLoading({title: '正在登录中...',mask: true});
uni.login({ uni.login({
provider: 'weixin', provider: 'weixin',
success: (weixinres) => { success: (weixinres) => {
console.log('uni.login')
console.log(weixinres)
if (weixinres.code) { if (weixinres.code) {
that.loginInfo = Userres.userInfo; that.loginInfo = Userres.userInfo;
that.loginInfo.encryptedData = Userres.encryptedData; that.loginInfo.encryptedData = Userres.encryptedData;
...@@ -105,7 +94,7 @@ ...@@ -105,7 +94,7 @@
uni.showToast({title: '登录成功',icon: 'none'}); uni.showToast({title: '登录成功',icon: 'none'});
if (that.code) { if (that.code) {
uni.redirectTo({ uni.redirectTo({
url: '../index/mall' url: '../index/machineDetail'
}) })
} else { } else {
uni.navigateBack(); uni.navigateBack();
...@@ -116,13 +105,11 @@ ...@@ -116,13 +105,11 @@
}) })
} else { } else {
uni.hideLoading(); uni.hideLoading();
console.log('登录失败!' + res.errMsg)
uni.showToast({title: '登录失败!',icon: 'none'}); uni.showToast({title: '登录失败!',icon: 'none'});
} }
}, },
fail: (err) => { fail: (err) => {
uni.hideLoading(); uni.hideLoading();
console.error('uni.login授权登录失败:' + JSON.stringify(err));
uni.showToast({title: '授权登录失败',icon: 'none'}); uni.showToast({title: '授权登录失败',icon: 'none'});
} }
}) })
...@@ -138,9 +125,9 @@ ...@@ -138,9 +125,9 @@
let that = this; let that = this;
uni.getSetting({ uni.getSetting({
success(res){ success(res){
console.log('获取用户信息是否用户同意') //console.log('获取用户信息是否用户同意')
console.log(res.authSetting) //console.log(res.authSetting)
console.log(res.authSetting['scope.userInfo']) //console.log(res.authSetting['scope.userInfo'])
} }
}) })
uni.getUserInfo({ uni.getUserInfo({
...@@ -152,8 +139,6 @@ ...@@ -152,8 +139,6 @@
uni.login({ uni.login({
provider: 'weixin', provider: 'weixin',
success: (weixinres) => { success: (weixinres) => {
console.log('uni.login')
console.log(weixinres)
if (weixinres.code) { if (weixinres.code) {
that.loginInfo = Userres.userInfo; that.loginInfo = Userres.userInfo;
that.loginInfo.encryptedData = Userres.encryptedData; that.loginInfo.encryptedData = Userres.encryptedData;
...@@ -177,7 +162,7 @@ ...@@ -177,7 +162,7 @@
uni.showToast({title: '登录成功',icon: 'none'}); uni.showToast({title: '登录成功',icon: 'none'});
if (that.code) { if (that.code) {
uni.redirectTo({ uni.redirectTo({
url: '../index/mall' url: '../index/machineDetail'
}) })
} else { } else {
uni.navigateBack(); uni.navigateBack();
...@@ -189,25 +174,23 @@ ...@@ -189,25 +174,23 @@
}) })
} else { } else {
uni.hideLoading(); uni.hideLoading();
console.error('uni.login授权登录失败:' + JSON.stringify(err));
uni.showToast({title: '授权登录失败',icon: 'none'}); uni.showToast({title: '授权登录失败',icon: 'none'});
} }
}, },
fail: (err) => { fail: (err) => {
uni.hideLoading(); uni.hideLoading();
console.error('授权登录失败:' + JSON.stringify(err));
uni.showToast({title: '授权登录失败',icon: 'none'}); uni.showToast({title: '授权登录失败',icon: 'none'});
} }
}) })
}, },
fail(err) { fail(err) {
uni.hideLoading(); uni.hideLoading();
console.log("wx.getUserProfile获取用户信息失败", err)
uni.showToast({title: '获取用户信息失败',icon: 'none'}); uni.showToast({title: '获取用户信息失败',icon: 'none'});
} }
}) })
}, },
// 打开权限设置页提示框
//打开权限设置页提示框
showSettingToast(e) { showSettingToast(e) {
const that = this const that = this
wx.showModal({ wx.showModal({
...@@ -218,7 +201,7 @@ ...@@ -218,7 +201,7 @@
content: e, content: e,
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
// /打开授权设置 ///打开授权设置
uni.openSetting({ uni.openSetting({
success(res) { success(res) {
if (res.authSetting['scope.userInfo']) { if (res.authSetting['scope.userInfo']) {
......
...@@ -162,8 +162,8 @@ const $AppContext = { ...@@ -162,8 +162,8 @@ const $AppContext = {
from: this.$AppContext.getCurrentPage().route, from: this.$AppContext.getCurrentPage().route,
userCallBack userCallBack
} }
console.log('### navigateTo: ' + this.$AppContext.$Navigate.from) //console.log('### navigateTo: ' + this.$AppContext.$Navigate.from)
console.warn($nothing._copy(this.$AppContext.$Navigate)) //console.warn($nothing._copy(this.$AppContext.$Navigate))
this.$AppContext.$router.push({ this.$AppContext.$router.push({
path, path,
isTab, isTab,
...@@ -218,8 +218,8 @@ const $AppContext = { ...@@ -218,8 +218,8 @@ const $AppContext = {
from: this.$AppContext.getPreviousPage().route, from: this.$AppContext.getPreviousPage().route,
userCallBack userCallBack
} }
console.log('### replaceTo: ' + this.$AppContext.$Navigate.from) //console.log('### replaceTo: ' + this.$AppContext.$Navigate.from)
console.warn($nothing._copy(this.$AppContext.$Navigate)) //console.warn($nothing._copy(this.$AppContext.$Navigate))
this.$AppContext.$router.replace({ this.$AppContext.$router.replace({
path path
}, onComplete, onAbort, onSuccess) }, onComplete, onAbort, onSuccess)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment