Commit 29f3deec by huahua

修改

parent ad6e9815
......@@ -5,7 +5,6 @@
:background="'none'"></myhead>
<view style="position: relative;width: 100%; height: 100%; z-index: 2;">
<!-- 轮播图 -->
<view v-if="statusloading == 1" class='swiper-box' style="width: 100%; height: 100%;">
<swiper :autoplay="true" :interval="3000" :duration="1000" @change="swiperChange"
......@@ -25,13 +24,13 @@
</view>
</view>
<view @click="Customize_now" hover-class="hover-class-bg" style="position: fixed; bottom: 100upx; left: 0; right: 0; margin: auto;
width: 300upx; height: 100upx;
background: linear-gradient(92deg, #F29F3D, #67C4CA);
box-shadow: 0px 19px 48px 1px rgba(20, 31, 62, 0.35);
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>
......@@ -68,7 +67,6 @@
<switchGoods ref="switchGoods" @selectGoodItem="selectGoodItem"></switchGoods>
<!--//商品弹框 -->
</view>
</template>
......@@ -104,7 +102,7 @@
goods: [], //商品列表
currentIndex: 0,
selectItem: null, //选择对象
name: "",
};
},
......@@ -113,17 +111,18 @@
//去排队列表
toLineList() {
if (!this.$AppContext.checkLogin()) {
this.tologo()
this.tologo(2)
} else {
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) {
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 @@
Customize_now() {
let that = this;
if (!this.$AppContext.checkLogin()) {
this.tologo()
this.tologo(1)
} else {
this.$refs['switchGoods'].open(this.machine_id);
}
......@@ -160,18 +159,26 @@
},
//授权登录
tologo() {
tologo(type) {
// 先登陆
let that = this;
uni.login({
provider: 'weixin',
success: (res) => {
console.log(res)
//appcode: that.$Env.getappcode()
userService.login({
s: 'Init.init',
code: res.code,
appcode: that.$Env.getappcode()
code: res.code
}).then(r => {
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 => {
that.$refs.Signin.init();
});
......
......@@ -93,7 +93,7 @@
//作品详情
Worksdetail(item) {
console.log(item)
//console.log(item)
this.$emit('Worksdetail', item)
},
......@@ -122,25 +122,6 @@
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) {
......@@ -188,9 +169,8 @@
loadData =true;
}
} */
let loadData = false;
if (item.e == 23 || item.e == 2) {
let loadData = true;
/* if (item.e == 23 || item.e == 2) {
if (this.queryPage.material_category_id != null && this.queryPage.material_category_id != "" && this
.queryPage.material_category_id != "null") {
if (this.queryPage.material_category_id == item.queryPage.material_category_id) {
......@@ -212,11 +192,10 @@
if (this.datalist ==null || this.datalist.length <= 0) {
loadData = true;
}
}
if (this.datalist ==null || this.datalist.length <= 0) {
} */
/*if (this.datalist ==null || this.datalist.length <= 0) {
loadData = true;
}
} */
this.queryPage = {
s: item.queryPage.s,
......@@ -230,7 +209,7 @@
material_series_id: item.queryPage.material_series_id, //贴图壁纸选择值二级分类
is_new: item.queryPage.is_new, //最新
is_hot: item.queryPage.is_hot, //热门
goods_id: item.queryPage.goods_id, //商品id
goods_id: "", //商品id
is_under: item.queryPage.is_under, //贴图是否为背景图
partner_id: item.queryPage.partner_id //代理
}
......
......@@ -10,11 +10,6 @@
你的第一份爱的定制在这里开始
</view>
<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"
@tap="getUserProfile">
......@@ -61,27 +56,21 @@
getUserProfile(e) {
uni.getSetting({
success(res){
console.log('获取用户信息是否用户同意')
console.log(res.authSetting)
console.log(res.authSetting['scope.userInfo'])
}
})
let that = this;
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
//推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
//开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
wx.getUserProfile({
lang:'zh_CN',
desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (Userres) => {
console.log('getUserInfo 获取头像昵称')
console.log(Userres)
that.$base.Userres = Userres
uni.showLoading({title: '正在登录中...',mask: true});
uni.login({
provider: 'weixin',
success: (weixinres) => {
console.log('uni.login')
console.log(weixinres)
if (weixinres.code) {
that.loginInfo = Userres.userInfo;
that.loginInfo.encryptedData = Userres.encryptedData;
......@@ -105,7 +94,7 @@
uni.showToast({title: '登录成功',icon: 'none'});
if (that.code) {
uni.redirectTo({
url: '../index/mall'
url: '../index/machineDetail'
})
} else {
uni.navigateBack();
......@@ -116,13 +105,11 @@
})
} else {
uni.hideLoading();
console.log('登录失败!' + res.errMsg)
uni.showToast({title: '登录失败!',icon: 'none'});
}
},
fail: (err) => {
uni.hideLoading();
console.error('uni.login授权登录失败:' + JSON.stringify(err));
uni.showToast({title: '授权登录失败',icon: 'none'});
}
})
......@@ -138,9 +125,9 @@
let that = this;
uni.getSetting({
success(res){
console.log('获取用户信息是否用户同意')
console.log(res.authSetting)
console.log(res.authSetting['scope.userInfo'])
//console.log('获取用户信息是否用户同意')
//console.log(res.authSetting)
//console.log(res.authSetting['scope.userInfo'])
}
})
uni.getUserInfo({
......@@ -152,8 +139,6 @@
uni.login({
provider: 'weixin',
success: (weixinres) => {
console.log('uni.login')
console.log(weixinres)
if (weixinres.code) {
that.loginInfo = Userres.userInfo;
that.loginInfo.encryptedData = Userres.encryptedData;
......@@ -177,7 +162,7 @@
uni.showToast({title: '登录成功',icon: 'none'});
if (that.code) {
uni.redirectTo({
url: '../index/mall'
url: '../index/machineDetail'
})
} else {
uni.navigateBack();
......@@ -189,25 +174,23 @@
})
} else {
uni.hideLoading();
console.error('uni.login授权登录失败:' + JSON.stringify(err));
uni.showToast({title: '授权登录失败',icon: 'none'});
}
},
fail: (err) => {
uni.hideLoading();
console.error('授权登录失败:' + JSON.stringify(err));
uni.showToast({title: '授权登录失败',icon: 'none'});
}
})
},
fail(err) {
uni.hideLoading();
console.log("wx.getUserProfile获取用户信息失败", err)
uni.showToast({title: '获取用户信息失败',icon: 'none'});
}
})
},
// 打开权限设置页提示框
//打开权限设置页提示框
showSettingToast(e) {
const that = this
wx.showModal({
......@@ -218,7 +201,7 @@
content: e,
success: function(res) {
if (res.confirm) {
// /打开授权设置
///打开授权设置
uni.openSetting({
success(res) {
if (res.authSetting['scope.userInfo']) {
......
......@@ -162,8 +162,8 @@ const $AppContext = {
from: this.$AppContext.getCurrentPage().route,
userCallBack
}
console.log('### navigateTo: ' + this.$AppContext.$Navigate.from)
console.warn($nothing._copy(this.$AppContext.$Navigate))
//console.log('### navigateTo: ' + this.$AppContext.$Navigate.from)
//console.warn($nothing._copy(this.$AppContext.$Navigate))
this.$AppContext.$router.push({
path,
isTab,
......@@ -218,8 +218,8 @@ const $AppContext = {
from: this.$AppContext.getPreviousPage().route,
userCallBack
}
console.log('### replaceTo: ' + this.$AppContext.$Navigate.from)
console.warn($nothing._copy(this.$AppContext.$Navigate))
//console.log('### replaceTo: ' + this.$AppContext.$Navigate.from)
//console.warn($nothing._copy(this.$AppContext.$Navigate))
this.$AppContext.$router.replace({
path
}, 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