作者 李芳银

修改登录

import {
request
} from "../../request/index.js"
const a = getApp()
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
imagesUrl: a.globalData.baseUrl,
canIUseGetUserProfile: false,
showDialog: false
},
onload() {
},
/**
* 组件的方法列表
*/
methods: {
getLogin(dens) {
console.log(dens);
if (wx.getUserProfile) {
this.setData({
canIUseGetUserProfile: true
})
}
this.toggleDialog()
},
bindGetUserInfo(e) { // 立即授权
let that = this;
wx.login({
success(res) {
console.log(res);
that.setData({
code: res.code
})
request({
url: 'api/common/login',
method: "POST",
data: {
rawData: e.detail.rawData,
code: that.data.code,
}
})
.then(res => {
console.log(res);
if (res.data.code == 1) {
wx.setStorageSync('token', res.data.data.userInfo.token);
wx.setStorageSync('avatar', res.data.data.userInfo.avatar);
wx.setStorageSync('name', res.data.data.userInfo.nickname);
wx.setStorageSync('user_id', res.data.data.userInfo.user_id);
}
console.log(res.data.data.userInfo.token);
that.toggleDialog()
a.popSuccessTest(res.data.msg);
that.getDetailsContent()
}).catch(err => {
console.log(err);
})
}
})
},
getUserProfile() {
let that = this
wx.login({
success(res) {
console.log(res);
that.setData({
code: res.code
})
}
})
wx.getUserProfile({
desc: '用于完善会员资料',
success: async (res) => {
console.log(res);
try {
const {
data
} = await request({
url: 'api/common/newLogin',
method: "POST",
data: {
userInfo: res.userInfo,
code: that.data.code,
}
})
console.log(data);
wx.setStorageSync('token', data.data.userInfo.token);
wx.setStorageSync('avatar', data.data.userInfo.avatar);
wx.setStorageSync('name', data.data.userInfo.nickname);
wx.setStorageSync('user_id', data.data.userInfo.user_id);
that.setData({
showDialog: false
})
a.popSuccessTest(data.msg)
that.triggerEvent('istoken', '李四')
} catch (err) {
console.log(err);
}
}
})
},
toggleDialog() {
this.setData({
showDialog: !this.data.showDialog
})
},
}
})
\ No newline at end of file
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
... ...
/* 弹窗 */
.zan_dialog {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
opacity: 0.5;
overflow: hidden;
z-index: 1000;
color: #fff;
}
.phoneshou {
height: 500rpx;
width: 100%;
overflow: hidden;
position: fixed;
bottom: 0;
left: 0;
z-index: 2000;
background: #fff;
padding: 32rpx 32rpx 0;
box-sizing: border-box;
border-radius: 24rpx 24rpx 0 0;
.padlock {
width: 100%;
height: 48rpx;
display: flex;
align-items: center;
justify-content: flex-end;
image {
width: 48rpx;
height: 48rpx;
}
}
.phone_title {
width: 100%;
height: 70rpx;
font-size: 44rpx;
line-height: 70rpx;
color: #06121F;
font-family: PingFangSC, PingFangSC-Regular;
}
.tips_content {
width: 100%;
font-size: 32rpx;
line-height: 60rpx;
color: #8C9198;
padding: 30rpx 0;
box-sizing: border-box;
}
.downbtn {
width: 750rpx;
position: fixed;
bottom: 0;
right: 0;
padding: 20rpx 0;
background-color: #fff;
.btn {
height: 100rpx;
width: 90%;
color: #fff;
padding: 0;
box-sizing: border-box;
font-size: 32rpx;
background-color: #00C25F;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50rpx;
image {
width: 60rpx;
height: 48rpx;
margin-right: 20rpx;
flex-shrink: 0;
}
}
.btn1 {
margin-bottom: 20rpx;
background-color: #ccc;
}
}
}
\ No newline at end of file
... ...
<!-- 弹窗 -->
<view class="zan_dialog" catchtap="toggleDialog" wx:if="{{showDialog}}"></view>
<view class="phoneshou" wx:if="{{showDialog}}">
<view class="padlock" catchtap="toggleDialog">
<image src="{{imagesUrl}}assets/static/img/updown.png" />
</view>
<view class="phone_title">请先授权登录</view>
<view class="tips_content">为了更好的为你提供服务,请允许微信授权后再使用功能</view>
<view class="downbtn">
<view class="si_box">
<button class="btn" wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile">
<image src="{{imagesUrl}}assets/static/img/icon_wechat.png" />
微信授权登录
</button>
<button class="btn" wx:else open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">
<image src="{{imagesUrl}}assets/static/img/icon_wechat.png" />
微信授权登录
</button>
</view>
</view>
</view>
\ No newline at end of file
... ...
/* 弹窗 */
.zan_dialog {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
opacity: 0.5;
overflow: hidden;
z-index: 1000;
color: #fff;
}
.phoneshou {
height: 500rpx;
width: 100%;
overflow: hidden;
position: fixed;
bottom: 0;
left: 0;
z-index: 2000;
background: #fff;
padding: 32rpx 32rpx 0;
box-sizing: border-box;
border-radius: 24rpx 24rpx 0 0;
}
.phoneshou .padlock {
width: 100%;
height: 48rpx;
display: flex;
align-items: center;
justify-content: flex-end;
}
.phoneshou .padlock image {
width: 48rpx;
height: 48rpx;
}
.phoneshou .phone_title {
width: 100%;
height: 70rpx;
font-size: 44rpx;
line-height: 70rpx;
color: #06121F;
font-family: PingFangSC, PingFangSC-Regular;
}
.phoneshou .tips_content {
width: 100%;
font-size: 32rpx;
line-height: 60rpx;
color: #8C9198;
padding: 30rpx 0;
box-sizing: border-box;
}
.phoneshou .downbtn {
width: 750rpx;
position: fixed;
bottom: 0;
right: 0;
padding: 20rpx 0;
background-color: #fff;
}
.phoneshou .downbtn .btn {
height: 100rpx;
width: 90%;
color: #fff;
padding: 0;
box-sizing: border-box;
font-size: 32rpx;
background-color: #00C25F;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50rpx;
}
.phoneshou .downbtn .btn image {
width: 60rpx;
height: 48rpx;
margin-right: 20rpx;
flex-shrink: 0;
}
.phoneshou .downbtn .btn1 {
margin-bottom: 20rpx;
background-color: #ccc;
}
... ...
... ... @@ -5,7 +5,7 @@
<view class="title_oage">车唛优选</view>
</view>
</view>
<view class="health" wx:if="{{S4Spage}}">
<view class="health" wx:if="{{S4Spage == true}}">
<view class="btd">
<view class="searchbox">
<view class="searchinput" bindtap="goSearch">
... ...
... ... @@ -170,6 +170,21 @@ Page({
that.getToken()
}
},
getToken() {
let that = this
wx.showModal({
title: '提示',
content: '您尚未登录,请登录后操作',
success: function (res) {
if (res.confirm) {
that.selectComponent('#lfyLogin').getLogin('hh')
} else {
console.log('点击取消回调')
wx.navigateBack()
}
}
})
},
onShareAppMessage(options) {
var that = this;
var shareObj = {
... ... @@ -229,6 +244,7 @@ Page({
content: '您尚未登录,请登录后操作',
success: function (res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/authorization/authorization'
})
... ... @@ -393,6 +409,9 @@ Page({
}
},
bindistoken() {
console.log('我回来了');
},
... ...
{
"usingComponents": {
"van-count-down": "@vant/weapp/count-down/index"
"van-count-down": "@vant/weapp/count-down/index",
"lfy-login":"../../Components/lfylogin"
},
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
... ...
... ... @@ -217,25 +217,6 @@
</button> -->
</view>
</view>
<view class="zan_dialog" catchtap="toggleDialog" wx:if="{{showDialog}}"></view>
<view class="phoneshou" wx:if="{{showDialog}}">
<view class="padlock" catchtap="toggleDialog">
<image src="{{imagesUrl}}assets/static/img/updown.png" />
</view>
<view class="phone_title">请先授权登录</view>
<view class="tips_content">为了更好的为你提供服务,请允许微信授权后再使用功能</view>
<view class="downbtn">
<!-- <button class="btn" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">
<image src="{{imagesUrl}}assets/static/img/icon_wechat.png" />
微信授权登录
</button> -->
<view class="si_box">
<button class="btn" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">
<image src="{{imagesUrl}}assets/static/img/icon_wechat.png" />
微信授权登录
</button>
</view>
</view>
</view>
<lfy-login id="lfyLogin" bind:istoken="bindistoken" />
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -9,7 +9,8 @@ Page({
encryptedData: '',
iv: '',
msg: '',
num: 0
num: 0,
canIUseGetUserProfile: true,
},
... ... @@ -17,14 +18,60 @@ Page({
},
onLoad: function (options) {
console.log(options);
let that = this
if (wx.getUserProfile) {
that.setData({
canIUseGetUserProfile: true
})
}
console.log(options);
that.setData({
num: options.num || ''
})
},
onShow: function () {},
getUserProfile() {
let that = this
wx.login({
success(res) {
console.log(res);
that.setData({
code: res.code
})
}
})
wx.getUserProfile({
desc: '用于完善会员资料',
success: async (res) => {
console.log(res);
try {
const {
data
} = await request({
url: 'api/common/newLogin',
method: "POST",
data: {
userInfo: res.userInfo,
code: that.data.code,
}
})
console.log(data);
wx.setStorageSync('token', data.data.userInfo.token);
wx.setStorageSync('avatar', data.data.userInfo.avatar);
wx.setStorageSync('name', data.data.userInfo.nickname);
wx.setStorageSync('user_id', data.data.userInfo.user_id);
that.showModal();
a.popSuccessTest(data.msg)
} catch (err) {
console.log(err);
a.popTest(err.msg)
}
}
})
},
// 立即授权
bindGetUserInfo(e) {
let that = this;
... ... @@ -62,7 +109,6 @@ Page({
}
}).catch(err => {
console.log(err);
})
}
})
... ...
... ... @@ -5,7 +5,10 @@
<view class="title">申请获得以下权限</view>
<view class="title_name">获得你的公开信息(昵称、头像等)</view>
<view class="bu">
<button class="btn" open-type='getUserInfo' bindgetuserinfo="bindGetUserInfo">立即授权</button>
<button class="btn" wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile">立即授权</button>
<button class="btn" wx:else open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">
立即授权
</button>
</view>
<!-- 屏幕背景变暗的背景 -->
<view class="commodity_screen" bindtap="hideModal" wx:if="{{showModalStatus}}"></view>
... ...
... ... @@ -25,7 +25,6 @@ Page({
pingList: [],
s4_id: '',
fx_user: '',
showDialog: false,
},
onLoad: function (options) {
... ... @@ -321,49 +320,6 @@ Page({
//如果有透明蒙层,弹窗的期间不能点击文档内容
})
},
toggleDialog() {
this.setData({
showDialog: !this.data.showDialog
})
},
bindGetUserInfo(e) { // 立即授权
let that = this;
wx.login({
success(res) {
console.log(res);
that.setData({
code: res.code
})
request({
url: 'api/common/login',
method: "POST",
data: {
rawData: e.detail.rawData,
code: that.data.code,
}
})
.then(res => {
console.log(res);
if (res.data.code == 1) {
wx.setStorageSync('token', res.data.data.userInfo.token);
wx.setStorageSync('avatar', res.data.data.userInfo.avatar);
wx.setStorageSync('name', res.data.data.userInfo.nickname);
wx.setStorageSync('user_id', res.data.data.userInfo.user_id);
}
console.log(res.data.data.userInfo.token);
that.toggleDialog()
that.setData({
msg: res.data.msg
})
that.popSuccessTest();
that.getDetailsContent()
}).catch(err => {
console.log(err);
})
}
})
},
GOcanvas() {
let id = this.data.id
let token = wx.getStorageSync("token")
... ... @@ -395,7 +351,7 @@ Page({
content: '您尚未登录,请登录后操作',
success: function (res) {
if (res.confirm) {
that.toggleDialog()
that.selectComponent('#lfyLogin').getLogin('哈哈哈是')
} else {
console.log('点击取消回调')
}
... ...
{
"usingComponents": {},
"usingComponents": {
"lfy-login":"../../Components/lfylogin"
},
"navigationBarTitleText": "车型详情"
}
\ No newline at end of file
... ...
.container {
height: 100%;
background-color: #F9F9F9;
.top_img {
width: 100%;
height: 750rpx;
.banner {
width: 100%;
height: 100%;
image {
width: 100%;
height: 100%;
}
}
}
.cards {
width: 100%;
padding: 14rpx 0rpx 0;
box-sizing: border-box;
.card {
width: 100%;
padding: 30rpx;
box-sizing: border-box;
background-color: #fff;
.ittt {
display: flex;
position: relative;
.tent_name {
flex: 1;
.card_text {
width: 100%;
font-size: 32rpx;
color: #06121F;
font-weight: bold;
}
.zan_price {
width: 100%;
display: flex;
align-items: baseline;
margin-top: 10rpx;
.money_icon {
font-size: 20rpx;
color: #FF444B;
font-weight: 600;
}
.price_big {
color: #FF444B;
font-size: 32rpx;
font-weight: 600;
}
}
}
.imgbtns {
width: 60rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: flex-end;
// justify-content: space-between;
.s_btn {
width: 48rpx;
height: 48rpx;
image {
width: 100%;
flex: 0 auto;
}
}
.mm {
margin: 10rpx 0;
box-sizing: border-box;
}
button {
background-color: transparent;
padding: 0;
}
.buttonShare {
// border: 1rpx solid red;
position: absolute;
top: 55rpx;
right: 0;
width: 60rpx;
height: 60rpx;
z-index: 5;
}
}
}
.store_guide_price {
width: 100%;
display: flex;
align-items: center;
text {
font-size: 24rpx;
line-height: 34rpx;
margin-right: 20rpx;
}
.imgs_downArrow {
height: 24rpx;
line-height: 34rpx;
display: flex;
align-items: center;
.imgs_down {
width: 33rpx;
height: 100%;
}
text {
font-size: 24rpx;
color: #00C116;
}
}
}
.card_box {
width: 100%;
display: flex;
.card_left {
flex: 1;
align-items: center;
line-height: 55rpx;
.price_dP {
display: flex;
align-items: center;
.del {
display: flex;
margin-left: 10rpx;
.del_price {
color: #ccc;
font-size: 24rpx;
text-decoration: line-through;
}
.money_icon {
font-size: 24rpx;
line-height: 52rpx;
color: #ccc;
}
}
.zan_price {
display: flex;
align-items: flex-end;
align-items: baseline;
.icon_name {
font-size: 28rpx;
color: #FF444B;
}
.money_icon {
margin-left: 10rpx;
font-size: 20rpx;
color: #FF444B;
font-weight: 600;
}
.price_big {
color: #FF444B;
font-size: 32rpx;
font-weight: 600;
}
}
}
.num_buy {
font-size: 28rpx;
display: flex;
align-items: center;
.sales {
font-size: 28rpx;
}
.sales_per {
margin-left: 5rpx;
font-size: 28rpx;
line-height: 63rpx;
}
}
}
.card_right {
flex: 1;
align-items: center;
line-height: 55rpx;
padding-left: 20rpx;
box-sizing: border-box;
.collar {
font-size: 24rpx;
color: #000;
}
.count_num {
font-size: 26rpx;
}
}
}
}
}
.chefuWu {
width: 100%;
display: flex;
justify-content: space-between;
padding: 20rpx 50rpx;
box-sizing: border-box;
border-radius: 8rpx;
background-color: #fff;
margin: 20rpx 0;
align-items: center;
.c {
flex: 1;
.icon_conte {
margin-top: 10rpx;
width: 100%;
display: flex;
align-items: center;
.fw {
display: flex;
align-items: center;
margin-right: 20rpx;
.icon_fw {
width: 48rpx;
height: 48rpx;
image {
width: 100%;
}
}
.icon_title {
margin-left: 10rpx;
font-size: 24rpx;
font-weight: bold;
color: #E8370F;
}
}
.pubone {
margin-left: 20rpx;
}
.pub {
color: #666666;
font-size: 24rpx;
margin-right: 20rpx;
}
}
}
.icon_img {
width: 35rpx;
font-size: 38rpx;
}
}
/* 详情 评价 */
.details {
width: 100%;
height: 130rpx;
background-color: #fff;
padding: 32rpx 32rpx;
box-sizing: border-box;
display: flex;
.details_name {
font-size: 28rpx;
height: 90rpx;
line-height: 90rpx;
}
.appraise_name {
font-size: 28rpx;
height: 90rpx;
line-height: 90rpx;
margin: 0 70rpx;
}
.cur {
border-bottom: 4rpx solid #E8370F;
font-weight: 700;
font-size: 36rpx !important;
}
}
.details_box {
padding-bottom: 120rpx;
.details_img {
width: 100%;
padding: 24rpx 18rpx 32rpx;
box-sizing: border-box;
background-color: #f5f5f5;
image {
visibility: middle;
}
}
// 评价内容
.praise_content {
width: 100%;
padding: 32rpx 32rpx;
box-sizing: border-box;
.person_content {
display: flex;
justify-content: space-between;
.left_ziliao {
display: flex;
align-items: center;
.imgNum {
width: 80rpx;
height: 80rpx;
image {
width: 100%;
}
}
.per_item {
display: flex;
justify-content: space-between;
flex-direction: column;
height: 80rpx;
margin-left: 20rpx;
.nickname {
font-size: 28rpx;
line-height: 40rpx;
font-weight: 600;
}
.dateTime {
color: #BDC4CE;
font-size: 24rpx;
line-height: 34rpx;
}
}
}
.praise_star {
width: 140rpx;
display: flex;
align-items: center;
image {
width: 48rpx;
height: 48rpx;
}
text {
margin-left: 20rpx;
font-size: 28rpx;
line-height: 40rpx;
}
}
}
.praise_text {
padding: 20rpx 0;
box-sizing: border-box;
font-size: 28rpx;
}
.imgsnox {
display: flex;
flex-wrap: wrap;
width: 100%;
.imgs {
width: 24%;
height: 172rpx;
margin: 5rpx 2rpx;
image {
border-radius: 12rpx;
width: 100%;
height: 100%;
}
}
}
}
.d {
padding: 32rpx;
box-sizing: border-box;
}
}
/* 立刻购买 */
.box_buy {
width: 100%;
background-color: #fff;
border-top: solid 1rpx #F9F9F9;
position: fixed;
bottom: 0;
left: 0;
.dowu {
width: 100%;
padding: 20rpx 32rpx;
box-sizing: border-box;
display: flex;
align-items: center;
.kefu {
width: 44rpx;
height: 44rpx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
margin-right: 20rpx;
.transparent {
background: transparent;
top: 0rpx;
left: 0;
border: none;
// border: 1rpx solid royalblue;
position: absolute;
width: 48rpx;
height: 48rpx;
padding: 0;
}
.img1 {
width: 44rpx;
height: 44rpx;
flex-shrink: 0;
}
}
.buy {
flex: 1;
display: flex;
align-items: center;
.bind {
width: 300rpx !important;
height: 68rpx;
color: #fff;
line-height: 68rpx;
padding: 0;
font-weight: 400;
margin-right: 20rpx !important;
font-size: 28rpx;
&:last-child {
margin-right: 0 !important;
}
}
.btn1 {
background-color: #FFBA00;
}
.btn2 {
background-color: #E8370F;
}
button {
margin: 0 !important;
padding: 0 !important;
}
}
}
}
// 弹窗
/*使屏幕变暗 */
.commodity_screen {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
opacity: 0.2;
overflow: hidden;
z-index: 1000;
color: #fff;
}
/*对话框 */
.commodity_attr_box {
height: 500rpx;
width: 100%;
overflow: hidden;
position: fixed;
bottom: 0;
left: 0;
z-index: 2000;
background: #fff;
padding: 20rpx;
box-sizing: border-box;
.updown {
width: 100%;
text-align: right;
image {
width: 40rpx;
height: 40rpx;
}
}
.buyStore {
display: flex;
align-items: center;
.storeImg {
width: 184rpx;
height: 184rpx;
image {
width: 100%;
}
}
.store_cont {
height: 184rpx;
flex: 1;
padding-left: 20rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: space-around;
.store_cont_name {
// line-height: 30rpx;
text {
font-size: 28rpx;
line-height: 30rpx;
font-weight: bold;
}
}
.storeMoney {
// margin-top: 30rpx;
.icon_money {
font-size: 24rpx;
line-height: 30rpx;
font-weight: bold;
}
text {
font-size: 28rpx;
color: #E8370F;
line-height: 30rpx;
font-weight: 600;
}
}
.yichange {
// margin-top: 15rpx;
.change__ {
font-size: 28rpx;
line-height: 30rpx;
font-weight: 600;
margin-right: 20rpx;
}
}
}
}
.rules {
margin-top: 20rpx;
.left_num {
display: flex;
flex-direction: column;
.guiName {
font-size: 28rpx;
line-height: 40rpx;
font-weight: bold;
margin: 20rpx 0;
}
.rules_change {
display: flex;
align-items: center;
flex-wrap: wrap;
.down {
padding: 5rpx 30rpx;
box-sizing: border-box;
margin: 10rpx 20rpx;
background-color: #f9f9f9;
border-radius: 10rpx;
.aaatext {
color: #000;
text-align: center;
font-size: 26rpx;
line-height: 50rpx;
}
}
}
}
}
.number {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 50rpx;
padding: 0 10rpx;
box-sizing: border-box;
.left_num {
font-size: 28rpx;
line-height: 40rpx;
font-weight: 600;
}
.right_num {
display: flex;
align-items: center;
.itemImg_ {
width: 40rpx;
height: 40rpx;
image {
width: 100%;
}
}
.center_num {
margin: 0 10rpx;
width: 60rpx;
text-align: center;
}
}
}
.btnbuy {
width: 100%;
position: fixed;
bottom: 0;
padding: 0;
.btnbuy__ {
height: 70rpx;
width: 92%;
color: #fff;
line-height: 70rpx;
padding: 0;
margin: 0 10rpx 10rpx;
box-sizing: border-box;
font-weight: 400;
background-color: #E8370F;
border-radius: 36rpx;
font-size: 28rpx;
}
}
}
.active_tag {
border: 2rpx solid rgba(232, 55, 15, 1);
.text {
color: rgba(232, 55, 15, 1);
}
}
/* 弹窗 */
.zan_dialog {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
opacity: 0.5;
overflow: hidden;
z-index: 1000;
color: #fff;
}
.phoneshou {
height: 500rpx;
width: 100%;
overflow: hidden;
position: fixed;
bottom: 0;
left: 0;
z-index: 2000;
background: #fff;
padding: 32rpx 32rpx 0;
box-sizing: border-box;
border-radius: 24rpx 24rpx 0 0;
.padlock {
width: 100%;
height: 48rpx;
display: flex;
align-items: center;
justify-content: flex-end;
image {
width: 48rpx;
height: 48rpx;
}
}
.phone_title {
width: 100%;
height: 70rpx;
font-size: 44rpx;
line-height: 70rpx;
color: #06121F;
font-family: PingFangSC, PingFangSC-Regular;
}
.tips_content {
width: 100%;
font-size: 32rpx;
line-height: 60rpx;
color: #8C9198;
padding: 30rpx 0;
box-sizing: border-box;
}
.downbtn {
width: 750rpx;
position: fixed;
bottom: 0;
right: 0;
padding: 20rpx 0;
background-color: #fff;
.btn {
height: 100rpx;
width: 90%;
color: #fff;
padding: 0;
box-sizing: border-box;
font-size: 32rpx;
background-color: #00C25F;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50rpx;
image {
width: 48rpx;
height: 48rpx;
margin-right: 20rpx;
}
}
.btn1 {
margin-bottom: 20rpx;
background-color: #ccc;
}
}
}
.container {
height: 100%;
background-color: #F9F9F9;
.top_img {
width: 100%;
height: 750rpx;
.banner {
width: 100%;
height: 100%;
image {
width: 100%;
height: 100%;
}
}
}
.cards {
width: 100%;
padding: 14rpx 0rpx 0;
box-sizing: border-box;
.card {
width: 100%;
padding: 30rpx;
box-sizing: border-box;
background-color: #fff;
.ittt {
display: flex;
position: relative;
.tent_name {
flex: 1;
.card_text {
width: 100%;
font-size: 32rpx;
color: #06121F;
font-weight: bold;
}
.zan_price {
width: 100%;
display: flex;
align-items: baseline;
margin-top: 10rpx;
.money_icon {
font-size: 20rpx;
color: #FF444B;
font-weight: 600;
}
.price_big {
color: #FF444B;
font-size: 32rpx;
font-weight: 600;
}
}
}
.imgbtns {
width: 60rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: flex-end;
// justify-content: space-between;
.s_btn {
width: 48rpx;
height: 48rpx;
image {
width: 100%;
flex: 0 auto;
}
}
.mm {
margin: 10rpx 0;
box-sizing: border-box;
}
button {
background-color: transparent;
padding: 0;
}
.buttonShare {
// border: 1rpx solid red;
position: absolute;
top: 55rpx;
right: 0;
width: 60rpx;
height: 60rpx;
z-index: 5;
}
}
}
.store_guide_price {
width: 100%;
display: flex;
align-items: center;
text {
font-size: 24rpx;
line-height: 34rpx;
margin-right: 20rpx;
}
.imgs_downArrow {
height: 24rpx;
line-height: 34rpx;
display: flex;
align-items: center;
.imgs_down {
width: 33rpx;
height: 100%;
}
text {
font-size: 24rpx;
color: #00C116;
}
}
}
.card_box {
width: 100%;
display: flex;
.card_left {
flex: 1;
align-items: center;
line-height: 55rpx;
.price_dP {
display: flex;
align-items: center;
.del {
display: flex;
margin-left: 10rpx;
.del_price {
color: #ccc;
font-size: 24rpx;
text-decoration: line-through;
}
.money_icon {
font-size: 24rpx;
line-height: 52rpx;
color: #ccc;
}
}
.zan_price {
display: flex;
align-items: flex-end;
align-items: baseline;
.icon_name {
font-size: 28rpx;
color: #FF444B;
}
.money_icon {
margin-left: 10rpx;
font-size: 20rpx;
color: #FF444B;
font-weight: 600;
}
.price_big {
color: #FF444B;
font-size: 32rpx;
font-weight: 600;
}
}
}
.num_buy {
font-size: 28rpx;
display: flex;
align-items: center;
.sales {
font-size: 28rpx;
}
.sales_per {
margin-left: 5rpx;
font-size: 28rpx;
line-height: 63rpx;
}
}
}
.card_right {
flex: 1;
align-items: center;
line-height: 55rpx;
padding-left: 20rpx;
box-sizing: border-box;
.collar {
font-size: 24rpx;
color: #000;
}
.count_num {
font-size: 26rpx;
}
}
}
}
}
.chefuWu {
width: 100%;
display: flex;
justify-content: space-between;
padding: 20rpx 50rpx;
box-sizing: border-box;
border-radius: 8rpx;
background-color: #fff;
margin: 20rpx 0;
align-items: center;
.c {
flex: 1;
.icon_conte {
margin-top: 10rpx;
width: 100%;
display: flex;
align-items: center;
.fw {
display: flex;
align-items: center;
margin-right: 20rpx;
.icon_fw {
width: 48rpx;
height: 48rpx;
image {
width: 100%;
}
}
.icon_title {
margin-left: 10rpx;
font-size: 24rpx;
font-weight: bold;
color: #E8370F;
}
}
.pubone {
margin-left: 20rpx;
}
.pub {
color: #666666;
font-size: 24rpx;
margin-right: 20rpx;
}
}
}
.icon_img {
width: 35rpx;
font-size: 38rpx;
}
}
/* 详情 评价 */
.details {
width: 100%;
height: 130rpx;
background-color: #fff;
padding: 32rpx 32rpx;
box-sizing: border-box;
display: flex;
.details_name {
font-size: 28rpx;
height: 90rpx;
line-height: 90rpx;
}
.appraise_name {
font-size: 28rpx;
height: 90rpx;
line-height: 90rpx;
margin: 0 70rpx;
}
.cur {
border-bottom: 4rpx solid #E8370F;
font-weight: 700;
font-size: 36rpx !important;
}
}
.details_box {
padding-bottom: 120rpx;
.details_img {
width: 100%;
padding: 24rpx 18rpx 32rpx;
box-sizing: border-box;
background-color: #f5f5f5;
image {
visibility: middle;
}
}
// 评价内容
.praise_content {
width: 100%;
padding: 32rpx 32rpx;
box-sizing: border-box;
.person_content {
display: flex;
justify-content: space-between;
.left_ziliao {
display: flex;
align-items: center;
.imgNum {
width: 80rpx;
height: 80rpx;
image {
width: 100%;
}
}
.per_item {
display: flex;
justify-content: space-between;
flex-direction: column;
height: 80rpx;
margin-left: 20rpx;
.nickname {
font-size: 28rpx;
line-height: 40rpx;
font-weight: 600;
}
.dateTime {
color: #BDC4CE;
font-size: 24rpx;
line-height: 34rpx;
}
}
}
.praise_star {
width: 140rpx;
display: flex;
align-items: center;
image {
width: 48rpx;
height: 48rpx;
}
text {
margin-left: 20rpx;
font-size: 28rpx;
line-height: 40rpx;
}
}
}
.praise_text {
padding: 20rpx 0;
box-sizing: border-box;
font-size: 28rpx;
}
.imgsnox {
display: flex;
flex-wrap: wrap;
width: 100%;
.imgs {
width: 24%;
height: 172rpx;
margin: 5rpx 2rpx;
image {
border-radius: 12rpx;
width: 100%;
height: 100%;
}
}
}
}
.d {
padding: 32rpx;
box-sizing: border-box;
}
}
/* 立刻购买 */
.box_buy {
width: 100%;
background-color: #fff;
border-top: solid 1rpx #F9F9F9;
position: fixed;
bottom: 0;
left: 0;
.dowu {
width: 100%;
padding: 20rpx 32rpx;
box-sizing: border-box;
display: flex;
align-items: center;
.kefu {
width: 44rpx;
height: 44rpx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
margin-right: 20rpx;
.transparent {
background: transparent;
top: 0rpx;
left: 0;
border: none;
// border: 1rpx solid royalblue;
position: absolute;
width: 48rpx;
height: 48rpx;
padding: 0;
}
.img1 {
width: 44rpx;
height: 44rpx;
flex-shrink: 0;
}
}
.buy {
flex: 1;
display: flex;
align-items: center;
.bind {
width: 300rpx !important;
height: 68rpx;
color: #fff;
line-height: 68rpx;
padding: 0;
font-weight: 400;
margin-right: 20rpx !important;
font-size: 28rpx;
&:last-child {
margin-right: 0 !important;
}
}
.btn1 {
background-color: #FFBA00;
}
.btn2 {
background-color: #E8370F;
}
button {
margin: 0 !important;
padding: 0 !important;
}
}
}
}
// 弹窗
/*使屏幕变暗 */
.commodity_screen {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
opacity: 0.2;
overflow: hidden;
z-index: 1000;
color: #fff;
}
/*对话框 */
.commodity_attr_box {
height: 500rpx;
width: 100%;
overflow: hidden;
position: fixed;
bottom: 0;
left: 0;
z-index: 2000;
background: #fff;
padding: 20rpx;
box-sizing: border-box;
.updown {
width: 100%;
text-align: right;
image {
width: 40rpx;
height: 40rpx;
}
}
.buyStore {
display: flex;
align-items: center;
.storeImg {
width: 184rpx;
height: 184rpx;
image {
width: 100%;
}
}
.store_cont {
height: 184rpx;
flex: 1;
padding-left: 20rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: space-around;
.store_cont_name {
// line-height: 30rpx;
text {
font-size: 28rpx;
line-height: 30rpx;
font-weight: bold;
}
}
.storeMoney {
// margin-top: 30rpx;
.icon_money {
font-size: 24rpx;
line-height: 30rpx;
font-weight: bold;
}
text {
font-size: 28rpx;
color: #E8370F;
line-height: 30rpx;
font-weight: 600;
}
}
.yichange {
// margin-top: 15rpx;
.change__ {
font-size: 28rpx;
line-height: 30rpx;
font-weight: 600;
margin-right: 20rpx;
}
}
}
}
.rules {
margin-top: 20rpx;
.left_num {
display: flex;
flex-direction: column;
.guiName {
font-size: 28rpx;
line-height: 40rpx;
font-weight: bold;
margin: 20rpx 0;
}
.rules_change {
display: flex;
align-items: center;
flex-wrap: wrap;
.down {
padding: 5rpx 30rpx;
box-sizing: border-box;
margin: 10rpx 20rpx;
background-color: #f9f9f9;
border-radius: 10rpx;
.aaatext {
color: #000;
text-align: center;
font-size: 26rpx;
line-height: 50rpx;
}
}
}
}
}
.number {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 50rpx;
padding: 0 10rpx;
box-sizing: border-box;
.left_num {
font-size: 28rpx;
line-height: 40rpx;
font-weight: 600;
}
.right_num {
display: flex;
align-items: center;
.itemImg_ {
width: 40rpx;
height: 40rpx;
image {
width: 100%;
}
}
.center_num {
margin: 0 10rpx;
width: 60rpx;
text-align: center;
}
}
}
.btnbuy {
width: 100%;
position: fixed;
bottom: 0;
padding: 0;
.btnbuy__ {
height: 70rpx;
width: 92%;
color: #fff;
line-height: 70rpx;
padding: 0;
margin: 0 10rpx 10rpx;
box-sizing: border-box;
font-weight: 400;
background-color: #E8370F;
border-radius: 36rpx;
font-size: 28rpx;
}
}
}
.active_tag {
border: 2rpx solid rgba(232, 55, 15, 1);
.text {
color: rgba(232, 55, 15, 1);
}
}
/* 弹窗 */
.zan_dialog {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
opacity: 0.5;
overflow: hidden;
z-index: 1000;
color: #fff;
}
.phoneshou {
height: 500rpx;
width: 100%;
overflow: hidden;
position: fixed;
bottom: 0;
left: 0;
z-index: 2000;
background: #fff;
padding: 32rpx 32rpx 0;
box-sizing: border-box;
border-radius: 24rpx 24rpx 0 0;
.padlock {
width: 100%;
height: 48rpx;
display: flex;
align-items: center;
justify-content: flex-end;
image {
width: 48rpx;
height: 48rpx;
}
}
.phone_title {
width: 100%;
height: 70rpx;
font-size: 44rpx;
line-height: 70rpx;
color: #06121F;
font-family: PingFangSC, PingFangSC-Regular;
}
.tips_content {
width: 100%;
font-size: 32rpx;
line-height: 60rpx;
color: #8C9198;
padding: 30rpx 0;
box-sizing: border-box;
}
.downbtn {
width: 750rpx;
position: fixed;
bottom: 0;
right: 0;
padding: 20rpx 0;
background-color: #fff;
.btn {
height: 100rpx;
width: 90%;
color: #fff;
padding: 0;
box-sizing: border-box;
font-size: 32rpx;
background-color: #00C25F;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50rpx;
image {
width: 48rpx;
height: 48rpx;
margin-right: 20rpx;
}
}
.btn1 {
margin-bottom: 20rpx;
background-color: #ccc;
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -118,21 +118,5 @@
</view>
</view>
</view>
<!-- 弹窗 -->
<view class="zan_dialog" catchtap="toggleDialog" wx:if="{{showDialog}}"></view>
<view class="phoneshou" wx:if="{{showDialog}}">
<view class="padlock" catchtap="toggleDialog">
<image src="{{imagesUrl}}assets/static/img/updown.png" />
</view>
<view class="phone_title">请先授权登录</view>
<view class="tips_content">为了更好的为你提供服务,请允许微信授权后再使用功能</view>
<view class="downbtn">
<view class="si_box">
<button class="btn" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">
<image src="{{imagesUrl}}assets/static/img/icon_wechat.png" />
微信授权登录
</button>
</view>
</view>
</view>
<lfy-login id="lfyLogin" />
</view>
\ No newline at end of file
... ...
... ... @@ -36,7 +36,6 @@ Page({
onLoad: function (options) {
console.log(options, "options");
let that = this
let token = wx.getStorageSync('token')
let user_id = wx.getStorageSync('user_id')
console.log(user_id, "wode user_id");
if (!options.scene) {
... ... @@ -70,11 +69,6 @@ Page({
}
that.getDetailsContent()
that.getPingList()
// if (token) {
// } else {
// that.getToken()
// }
},
onShow: function () {
... ... @@ -136,7 +130,7 @@ Page({
content: '您尚未登录,请登录后操作',
success: function (res) {
if (res.confirm) {
that.showModal1()
that.selectComponent('#lfyLogin').getLogin('hh')
} else {
console.log('点击取消回调')
wx.navigateBack()
... ... @@ -365,26 +359,6 @@ Page({
})
}.bind(this), 100)
},
showModal1() { //显示对话框
// 显示遮罩层
var animation = wx.createAnimation({
duration: 200,
timingFunction: "linear",
delay: 0
})
this.animation = animation
animation.translateY(300).step()
this.setData({
animationData: animation.export(),
showModalStatu: true
})
setTimeout(function () {
animation.translateY(0).step()
this.setData({
animationData: animation.export()
})
}.bind(this), 100)
},
hideModal() { //隐藏对话框
// 隐藏遮罩层
var animation = wx.createAnimation({
... ... @@ -405,26 +379,6 @@ Page({
})
}.bind(this), 100)
},
hideModal1() { //隐藏对话框
// 隐藏遮罩层
var animation = wx.createAnimation({
duration: 200,
timingFunction: "linear",
delay: 0
})
this.animation = animation
animation.translateY(300).step()
this.setData({
animationData: animation.export(),
})
setTimeout(function () {
animation.translateY(0).step()
this.setData({
animationData: animation.export(),
showModalStatu: false
})
}.bind(this), 100)
},
countMinus() { // 商品数量减
let that = this
let a = that.data.num - 1
... ... @@ -503,44 +457,6 @@ Page({
// console.log(texts)
return texts;
},
bindGetUserInfo(e) { // 立即授权
let that = this;
wx.login({
success(res) {
console.log(res);
that.setData({
code: res.code
})
request({
url: 'api/common/login',
method: "POST",
data: {
rawData: e.detail.rawData,
code: that.data.code,
}
})
.then(res => {
console.log(res);
if (res.data.code == 1) {
wx.setStorageSync('token', res.data.data.userInfo.token);
wx.setStorageSync('avatar', res.data.data.userInfo.avatar);
wx.setStorageSync('name', res.data.data.userInfo.nickname);
wx.setStorageSync('user_id', res.data.data.userInfo.user_id);
}
console.log(res.data.data.userInfo.token);
that.hideModal1()
that.setData({
msg: res.data.msg
})
that.popSuccessTest();
that.getDetailsContent()
}).catch(err => {
console.log(err);
})
}
})
},
popSuccessTest() {
wx.showToast({
title: this.data.msg,
... ... @@ -548,7 +464,10 @@ Page({
duration: 1300, //停留时间
})
},
bindistoken() {
this.getDetailsContent()
console.log('我回来了');
},
})
\ No newline at end of file
... ...
{
"usingComponents": {
"lfy-login":"../../Components/lfylogin"
},
"navigationBarTitleText": "商品详情"
}
\ No newline at end of file
... ...
... ... @@ -258,27 +258,5 @@
</button>
</view>
</view>
<!-- 授权登录 -->
<view class="login">
<!-- 屏幕背景变暗的背景 -->
<view class="commodity_screen" bindtap="hideModal1" wx:if="{{showModalStatu}}"></view>
<!-- 弹出框 -->
<view animation="{{animationData}}" class="commodity_attr_box" wx:if="{{showModalStatu}}">
<view class="phoneshou">
<view class="padlock" catchtap="hideModal1">
<image src="{{imagesUrl}}assets/static/img/updown.png" />
</view>
<view class="phone_title">请先授权登录</view>
<view class="tips_content">为了更好的为你提供服务,请允许微信授权后再使用功能</view>
<view class="downbtn">
<view class="si_box">
<button class="btn" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">
<image src="{{imagesUrl}}assets/static/img/icon_wechat.png" />
微信授权登录
</button>
</view>
</view>
</view>
</view>
</view>
<lfy-login id="lfyLogin" bind:istoken="bindistoken" />
</view>
\ No newline at end of file
... ...
... ... @@ -43,7 +43,8 @@ Page({
content: '您尚未登录,请登录后操作',
success: function (res) {
if (res.confirm) {
that.showModal()
// that.showModal()
that.selectComponent('#lfyLogin').getLogin('hh')
} else {
wx.switchTab({
url: '/pages/home/home'
... ... @@ -203,85 +204,6 @@ Page({
return texts
},
showModal() { //显示对话框
var animation = wx.createAnimation({
duration: 200,
timingFunction: "linear",
delay: 0
})
this.animation = animation
animation.translateY(300).step()
this.setData({
animationData: animation.export(),
showModalStatus: true
})
setTimeout(function () {
animation.translateY(0).step()
this.setData({
animationData: animation.export()
})
}.bind(this), 100)
},
hideModal() { //隐藏对话框
var animation = wx.createAnimation({
duration: 200,
timingFunction: "linear",
delay: 0
})
this.animation = animation
animation.translateY(300).step()
this.setData({
animationData: animation.export(),
})
setTimeout(function () {
animation.translateY(0).step()
this.setData({
animationData: animation.export(),
showModalStatus: false
})
}.bind(this), 100)
},
bindGetUserInfo(e) { // 立即授权
let that = this;
wx.login({
success(res) {
console.log(res);
that.setData({
code: res.code
})
request({
url: 'api/common/login',
method: "POST",
data: {
rawData: e.detail.rawData,
code: that.data.code,
}
})
.then(res => {
console.log(res);
if (res.data.code == 1) {
wx.setStorageSync('token', res.data.data.userInfo.token);
wx.setStorageSync('avatar', res.data.data.userInfo.avatar);
wx.setStorageSync('name', res.data.data.userInfo.nickname);
wx.setStorageSync('user_id', res.data.data.userInfo.user_id);
}
console.log(res.data.data.userInfo.token);
that.hideModal()
that.setData({
msg: res.data.msg
})
that.popSuccessTest();
that.gethuodong()
// setTimeout(function () {
// wx.navigateBack()
// }, 2000)
}).catch(err => {
console.log(err);
})
}
})
},
onShareAppMessage: function (options) {
var that = this;
// 设置菜单中的转发按钮触发转发事件时的转发内容
... ... @@ -319,7 +241,10 @@ Page({
duration: 1300, //停留时间
})
},
bindistoken() {
this.gethuodong()
console.log('我回来了');
},
... ...
{
"usingComponents": {
"van-count-down": "@vant/weapp/count-down/index"
"van-count-down": "@vant/weapp/count-down/index",
"lfy-login":"../../Components/lfylogin"
},
"navigationBarTitleText": "商品详情"
... ...
... ... @@ -82,27 +82,5 @@
</view>
</view>
</view>
<!-- 授权登录 -->
<view class="login">
<!-- 屏幕背景变暗的背景 -->
<view class="commodity_screen" bindtap="hideModal" wx:if="{{showModalStatus}}"></view>
<!-- 弹出框 -->
<view animation="{{animationData}}" class="commodity_attr_box" wx:if="{{showModalStatus}}">
<view class="phoneshou">
<view class="padlock" catchtap="hideModal">
<image src="{{imagesUrl}}assets/static/img/updown.png" />
</view>
<view class="phone_title">请先授权登录</view>
<view class="tips_content">为了更好的为你提供服务,请允许微信授权后再使用功能</view>
<view class="downbtn">
<view class="si_box">
<button class="btn" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">
<image src="{{imagesUrl}}assets/static/img/icon_wechat.png" />
微信授权登录
</button>
</view>
</view>
</view>
</view>
</view>
<lfy-login id="lfyLogin" bind:istoken="bindistoken" />
</view>
\ No newline at end of file
... ...
... ... @@ -2,7 +2,6 @@ import {
request
} from "../../request/index.js"
// pages/distributionChanged/distributionChanged.js
const a = getApp()
Page({
data: {
... ... @@ -32,13 +31,7 @@ Page({
})
that.getdetails()
},
onReady: function () {
},
onShow: function () {},
toggleDialog() {
},
async getdetails() {
let that = this
try {
... ... @@ -61,6 +54,7 @@ Page({
})
console.log(data);
console.log(this.data.jump_url);
} catch (err) {
console.log(err);
that.setData({
... ... @@ -208,7 +202,6 @@ Page({
})
}, 1500);
}
} else {
console.log(that.data.jump_img);
if (that.data.jump_img != '') {
... ... @@ -242,8 +235,9 @@ Page({
},
jumpImgUrl() {
let that = this
console.log(that.data.jump_url);
wx.navigateTo({
url: '/pages/webview/webview?url=' + that.data.jump_url
url: '/pages/webview/webview?url=' + encodeURIComponent(that.data.jump_url)
})
that.hideModal()
},
... ...
... ... @@ -296,7 +296,7 @@ page {
/*对话框 */
.center__nox {
height: 40%;
// height: 40%;
width: 80%;
position: fixed;
top: 40%;
... ...
... ... @@ -235,7 +235,6 @@ page {
z-index: 10;
}
.container .login .center__nox {
height: 40%;
width: 80%;
position: fixed;
top: 40%;
... ...
... ... @@ -333,48 +333,9 @@ Page({
//如果有透明蒙层,弹窗的期间不能点击文档内容
})
},
toggleDialog() {
this.setData({
showDialog: !this.data.showDialog
})
},
bindGetUserInfo(e) { // 立即授权
let that = this;
wx.login({
success(res) {
console.log(res);
that.setData({
code: res.code
})
request({
url: 'api/common/login',
method: "POST",
data: {
rawData: e.detail.rawData,
code: that.data.code,
}
})
.then(res => {
console.log(res);
if (res.data.code == 1) {
wx.setStorageSync('token', res.data.data.userInfo.token);
wx.setStorageSync('avatar', res.data.data.userInfo.avatar);
wx.setStorageSync('name', res.data.data.userInfo.nickname);
wx.setStorageSync('user_id', res.data.data.userInfo.user_id);
}
console.log(res.data.data.userInfo.token);
that.toggleDialog()
that.setData({
msg: res.data.msg
})
that.popSuccessTest();
that.getDetailsContent()
}).catch(err => {
console.log(err);
})
}
})
bindistoken() {
this.getDetailsContent()
console.log('我回来了');
},
GOcanvas() {
let id = this.data.id
... ...
{
"usingComponents": {},
"usingComponents": {
"lfy-login":"../../Components/lfylogin"
},
"navigationBarTitleText": "商品详情"
}
\ No newline at end of file
... ...
... ... @@ -206,4 +206,5 @@
</view>
</view>
</view>
<lfy-login id="lfyLogin" bind:istoken="bindistoken" />
</view>
\ No newline at end of file
... ...
... ... @@ -51,9 +51,11 @@ Page({
},
gohome() {
wx.switchTab({
url: '/pages/home/home'
})
this.selectComponent('#lfyLogin').getLogin('哈哈哈')
},
bindisToken(e) {
console.log(e);
console.log('我回来了');
},
onChange(e) {
this.setData({
... ... @@ -74,7 +76,7 @@ Page({
let index = e.currentTarget.dataset.index
if (index == 0) {
wx.navigateTo({
url: '/pages/webview/webview?url=' + 'https://h5.goorcar.com/'
url: '/pages/webview/webview?url=' + encodeURIComponent('https://h5.goorcar.com/')
})
}
... ...
{
"usingComponents": {
"van-count-down": "@vant/weapp/count-down/index"
"van-count-down": "@vant/weapp/count-down/index",
"lfy-login":"../../Components/lfylogin"
},
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
... ...
... ... @@ -2,7 +2,7 @@
<view class="header">
<view class="s" style='height:{{statusTop}}px'></view>
<view class="left_img">
<view class="title_oage" bindtap="gohome">汽车互联网4S店</view>
<view class="title_oage">汽车互联网4S店</view>
</view>
</view>
<view class="health">
... ... @@ -192,5 +192,6 @@
<view class="more_name">关注更多4S店</view>
</view>
</view>
<lfy-login id="lfyLogin" bind:istoken="bindisToken" />
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -27,30 +27,21 @@ Page({
guiID: [],
goodsPrice: '',
user_id: '',
showDialog: false,
fx_user: '',
s4_id: '',
},
onLoad: function (options) {
let that = this
let token = wx.getStorageSync('token')
console.log(options);
if (!options.scene) {
that.setData({
id: options.id,
})
console.log(options);
} else {
that.setData({
id: options.scene,
})
console.log(options);
}
// if (token) {
// } else {
// that.getToken()
// }
that.getDetailsContent()
},
previewImage: function (e) {
... ... @@ -69,7 +60,7 @@ Page({
content: '您尚未登录,请登录后操作',
success: function (res) {
if (res.confirm) {
that.toggleDialog()
that.selectComponent('#lfyLogin').getLogin('hh')
} else {
console.log('点击取消回调')
wx.navigateBack()
... ... @@ -80,10 +71,6 @@ Page({
},
onShow: function () {
// let token = wx.getStorageSync("token")
// if (token) {
// }
this.getPingList()
},
GOcanvas() {
... ... @@ -328,23 +315,8 @@ Page({
})
} else {
wx.showModal({
title: '提示',
content: '您尚未登录,请登录后操作',
success: function (res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/authorization/authorization'
})
} else {
console.log('点击取消回调')
}
}
})
that.getToken()
}
},
countMinus() { // 商品数量减
let that = this
... ... @@ -644,47 +616,4 @@ Page({
return shareObj;
},
toggleDialog() {
this.setData({
showDialog: !this.data.showDialog
})
},
bindGetUserInfo(e) { // 立即授权
let that = this;
wx.login({
success(res) {
console.log(res);
that.setData({
code: res.code
})
request({
url: 'api/common/login',
method: "POST",
data: {
rawData: e.detail.rawData,
code: that.data.code,
}
})
.then(res => {
console.log(res);
if (res.data.code == 1) {
wx.setStorageSync('token', res.data.data.userInfo.token);
wx.setStorageSync('avatar', res.data.data.userInfo.avatar);
wx.setStorageSync('name', res.data.data.userInfo.nickname);
wx.setStorageSync('user_id', res.data.data.userInfo.user_id);
}
console.log(res.data.data.userInfo.token);
that.toggleDialog()
that.setData({
msg: res.data.msg
})
that.popSuccessTest();
that.getDetailsContent()
}).catch(err => {
console.log(err);
})
}
})
},
})
\ No newline at end of file
... ...
{
"usingComponents": {},
"usingComponents": {
"lfy-login":"../../Components/lfylogin"
},
"navigationBarTitleText": "商品详情"
}
\ No newline at end of file
... ...
... ... @@ -237,24 +237,5 @@
</button>
</view>
</view>
<view class="zan_dialog" catchtap="toggleDialog" wx:if="{{showDialog}}"></view>
<view class="phoneshou" wx:if="{{showDialog}}">
<view class="padlock" catchtap="toggleDialog">
<image src="{{imagesUrl}}assets/static/img/updown.png" />
</view>
<view class="phone_title">请先授权登录</view>
<view class="tips_content">为了更好的为你提供服务,请允许微信授权后再使用功能</view>
<view class="downbtn">
<!-- <button class="btn" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">
<image src="{{imagesUrl}}assets/static/img/icon_wechat.png" />
微信授权登录
</button> -->
<view class="si_box">
<button class="btn" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">
<image src="{{imagesUrl}}assets/static/img/icon_wechat.png" />
微信授权登录
</button>
</view>
</view>
</view>
<lfy-login id="lfyLogin" bind:istoken="bindistoken" />
</view>
\ No newline at end of file
... ...
... ... @@ -9,7 +9,6 @@ Page({
id: '',
MaintainImg: '',
content: '',
showDialog: false,
pingListL: [],
msg: ''
},
... ... @@ -136,7 +135,7 @@ Page({
content: '您尚未登录,请登录后操作',
success: function (res) {
if (res.confirm) {
that.toggleDialog()
that.selectComponent('#lfyLogin').getLogin('hh')
} else {
console.log('点击取消回调')
}
... ... @@ -190,53 +189,6 @@ Page({
},
toggleDialog() {
this.setData({
showDialog: !this.data.showDialog
})
},
bindGetUserInfo(e) { // 立即授权
let that = this;
wx.login({
success(res) {
console.log(res);
that.setData({
code: res.code
})
request({
url: 'api/common/login',
method: "POST",
data: {
rawData: e.detail.rawData,
code: that.data.code,
}
})
.then(res => {
console.log(res);
if (res.data.code == 1) {
wx.setStorageSync('token', res.data.data.userInfo.token);
wx.setStorageSync('avatar', res.data.data.userInfo.avatar);
wx.setStorageSync('name', res.data.data.userInfo.nickname);
wx.setStorageSync('user_id', res.data.data.userInfo.user_id);
}
console.log(res.data.data.userInfo.token);
that.toggleDialog()
that.setData({
msg: res.data.msg
})
that.popSuccessTest();
that.getStoreMaintainImg()
}).catch(err => {
console.log(err);
that.setData({
msg: err.msg
})
that.popMaskTest()
})
}
})
},
previewImage: function (e) {
var current = e.target.dataset.src;
var imgList = e.target.dataset.list
... ... @@ -262,4 +214,8 @@ Page({
//如果有透明蒙层,弹窗的期间不能点击文档内容
})
},
bindistoken() {
this.getStoreMaintainImg()
console.log('我回来了');
},
})
\ No newline at end of file
... ...
{
"usingComponents": {},
"usingComponents": {
"lfy-login":"../../Components/lfylogin"
},
"navigationBarTitleText": "保养商品详情"
}
\ No newline at end of file
... ...
... ... @@ -130,24 +130,5 @@
<view class="d" wx:else>暂无评价</view>
</block>
</view>
<view class="zan_dialog" catchtap="toggleDialog" wx:if="{{showDialog}}"></view>
<view class="phoneshou" wx:if="{{showDialog}}">
<view class="padlock" catchtap="toggleDialog">
<image src="{{imagesUrl}}assets/static/img/updown.png" />
</view>
<view class="phone_title">请先授权登录</view>
<view class="tips_content">为了更好的为你提供服务,请允许微信授权后再使用功能</view>
<view class="downbtn">
<!-- <button class="btn" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">
<image src="{{imagesUrl}}assets/static/img/icon_wechat.png" />
微信授权登录
</button> -->
<view class="si_box">
<button class="btn" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">
<image src="{{imagesUrl}}assets/static/img/icon_wechat.png" />
微信授权登录
</button>
</view>
</view>
</view>
<lfy-login id="lfyLogin" bind:istoken="bindistoken" />
</view>
\ No newline at end of file
... ...
... ... @@ -12,9 +12,9 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
console.log(decodeURIComponent(options.url))
this.setData({
waiUrl: options.url
waiUrl: decodeURIComponent(options.url)
})
},
... ...
... ... @@ -40,7 +40,7 @@
"minifyWXSS": true
},
"compileType": "miniprogram",
"libVersion": "2.11.0",
"libVersion": "2.16.0",
"appid": "wx11011d1f9492b8e0",
"projectname": "%E8%BD%A6%E5%94%9B",
"debugOptions": {
... ...
{
"condition": {
"plugin": {
"list": []
},
"game": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": [
{
"id": -1,
"name": "pages/stores/index",
"pathName": "pages/stores/index",
"query": "",
"scene": null
},
{
"name": "pages/praise/praise",
"pathName": "pages/praise/praise",
"query": "",
"scene": null
},
{
"name": "pages/goPromotion/goPromotion",
"pathName": "pages/goPromotion/goPromotion",
"query": "",
"scene": null
},
{
"name": "pages/VtuanDetail/VtuanDetail",
"pathName": "pages/VtuanDetail/VtuanDetail",
"query": "type=4&id=4073",
"scene": null
},
{
"name": "pages/home/home",
"pathName": "pages/home/home",
"query": "",
"scene": null
},
{
"name": "pages/details/details",
"pathName": "pages/details/details",
"query": "",
"scene": null
},
{
"name": "pages/addcars/addcars",
"pathName": "pages/addcars/addcars",
"query": "",
"scene": null
},
{
"name": "pages/homeNoLogin2/homeNoLogin2",
"pathName": "pages/homeNoLogin2/homeNoLogin2",
"query": "",
"scene": null
},
{
"name": "pages/distributionChanged/distributionChanged",
"pathName": "pages/distributionChanged/distributionChanged",
"query": "id=59",
"scene": null
}
]
}
}
}
\ No newline at end of file
... ...