Commit 31a5a3de authored by 黄奎's avatar 黄奎

1111

parents a608cd0e 111c5e82
<template> <template>
<div class="auth-page"> <div class="auth-page">
<u-popup v-model="showDialog" mode="center" :mask-close-able="false" custom-style="padding:0;background:none;"> <u-popup
v-model="showDialog"
mode="center"
:mask-close-able="false"
custom-style="padding:0;background:none;"
>
<img :src="pageinfo.pic_url" mode="widthFix" /> <img :src="pageinfo.pic_url" mode="widthFix" />
<button :style="sureStyle" class="hotsopt" open-type="getUserInfo" v-if="canIUseGetUserProfile == false" <button
@getuserinfo="showLogin == true ? getoldUser() : ''"></button> :style="sureStyle"
<button :style="sureStyle" class="hotsopt" v-if="canIUseGetUserProfile == true" @tap="showLogin == true ? getUserProfile() : ''"></button> class="hotsopt"
open-type="getUserInfo"
v-if="canIUseGetUserProfile == false"
@getuserinfo="showLogin == true ? getoldUser() : ''"
></button>
<button
:style="sureStyle"
class="hotsopt"
v-if="canIUseGetUserProfile == true"
@tap="showLogin == true ? getUserProfile() : ''"
></button>
<button :style="cancelStyle" class="hotsopt" @click="close"></button> <button :style="cancelStyle" class="hotsopt" @click="close"></button>
</u-popup> </u-popup>
<coupon v-if="showCoupons" :coupon-message="couponMessage" :cform="ComeFrom" @goLook="goLook" @closeBtn="closeBtn"></coupon> <coupon
v-if="showCoupons"
:coupon-message="couponMessage"
:cform="ComeFrom"
@goLook="goLook"
@closeBtn="closeBtn"
></coupon>
</div> </div>
</template> </template>
<script> <script>
import coupon from "@/components/coupons/coupons"; import coupon from "@/components/coupons/coupons";
export default { export default {
components: { components: {
coupon, coupon,
}, },
...@@ -32,8 +53,9 @@ ...@@ -32,8 +53,9 @@
}; };
}, },
created() { created() {
this.pageinfo = uni.getStorageSync("basedata") ? this.pageinfo = uni.getStorageSync("basedata")
uni.getStorageSync("basedata").auth_page : {}; ? uni.getStorageSync("basedata").auth_page
: {};
if (wx.getUserProfile) { if (wx.getUserProfile) {
console.log("进入新的"); console.log("进入新的");
this.canIUseGetUserProfile = true; this.canIUseGetUserProfile = true;
...@@ -72,32 +94,50 @@ ...@@ -72,32 +94,50 @@
getUserProfile() { getUserProfile() {
//新的获取用户资料 //新的获取用户资料
var that = this; var that = this;
wx.getUserProfile({ wx.login({
desc: "用于完善资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 success: res => {
success: (info) => { let obj = {
console.log(info); Source: 1,
this.msg = { OpenId: "",
Id: 0, // Name: info.userInfo.nickName,
AliasName: info.userInfo.nickName, // Photo: info.userInfo.avatarUrl,
Photo: info.userInfo.avatarUrl, // Gender: info.userInfo.gender,
}; Moblie: "",
that.getUserInfo(info); SuperiorId: 0,
code: res.code,
}
that.getCode(obj);
}, },
fail: () => { fail: (err) => {
uni.showToast({ console.log(err,'=====err');
title: "微信登录授权失败",
icon: "none",
});
}, },
}); })
// wx.getUserProfile({
// desc: "用于完善资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
// success: (info) => {
// console.log(info);
// this.msg = {
// Id: 0,
// AliasName: info.userInfo.nickName,
// Photo: info.userInfo.avatarUrl,
// };
// that.getUserInfo(info);
// },
// fail: (err) => {
// uni.showToast({
// title: "微信登录授权失败",
// icon: "none",
// });
// },
// });
}, },
getUserInfo(info) { getUserInfo(info) {
var that = this; var that = this;
that.showDialog = true; that.showDialog = true;
uni.getProvider({ uni.getProvider({
service: "oauth", service: "oauth",
success: function(res) { success: function (res) {
if (~res.provider.indexOf("weixin")) { if (res.provider.indexOf("weixin")) {
uni.login({ uni.login({
provider: "weixin", provider: "weixin",
success: (res) => { success: (res) => {
...@@ -142,7 +182,8 @@ ...@@ -142,7 +182,8 @@
}); });
//这里请求接口 //这里请求接口
var OpenId = ""; var OpenId = "";
that.request2({ that.request2(
{
url: "/api/mall/GetWeChatOpenId", url: "/api/mall/GetWeChatOpenId",
data: { data: {
Code: obj.code, Code: obj.code,
...@@ -163,22 +204,23 @@ ...@@ -163,22 +204,23 @@
let pid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0; let pid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
let Up = uni.getStorageSync("Up") ? uni.getStorageSync("Up").Up : 0; let Up = uni.getStorageSync("Up") ? uni.getStorageSync("Up").Up : 0;
let SmallShopId = uni.getStorageSync("SmallShopId") ? let SmallShopId = uni.getStorageSync("SmallShopId")
uni.getStorageSync("SmallShopId").SmallShopId : ? uni.getStorageSync("SmallShopId").SmallShopId
0; : 0;
let CounponPassword = uni.getStorageSync("CounponPassword") ? let CounponPassword = uni.getStorageSync("CounponPassword")
uni.getStorageSync("CounponPassword").CounponPassword : ? uni.getStorageSync("CounponPassword").CounponPassword
0; : 0;
let KeyWord = uni.getStorageSync("KeyWord") ? let KeyWord = uni.getStorageSync("KeyWord")
uni.getStorageSync("KeyWord").KeyWord : ? uni.getStorageSync("KeyWord").KeyWord
""; : "";
let EduSchoolId = uni.getStorageSync("EduSchoolId") ? let EduSchoolId = uni.getStorageSync("EduSchoolId")
uni.getStorageSync("EduSchoolId").EduSchoolId : ? uni.getStorageSync("EduSchoolId").EduSchoolId
0; : 0;
let EduId = uni.getStorageSync("jxhData") ? let EduId = uni.getStorageSync("jxhData")
uni.getStorageSync("jxhData").Id : ? uni.getStorageSync("jxhData").Id
0; : 0;
that.request2({ that.request2(
{
url: "/api/AppletLogin/Login", url: "/api/AppletLogin/Login",
data: { data: {
Source: 1, Source: 1,
...@@ -193,7 +235,7 @@ ...@@ -193,7 +235,7 @@
CounponPassword: CounponPassword, CounponPassword: CounponPassword,
KeyWord: KeyWord, KeyWord: KeyWord,
EduSchoolId: EduSchoolId, EduSchoolId: EduSchoolId,
EduId: EduId EduId:EduId
}, },
}, },
(res) => { (res) => {
...@@ -225,9 +267,9 @@ ...@@ -225,9 +267,9 @@
let uid = uni.getStorageSync("mall_UserInfo").UserId; let uid = uni.getStorageSync("mall_UserInfo").UserId;
uni.removeStorageSync("EduSchoolId"); uni.removeStorageSync("EduSchoolId");
that.msg.Id = uid; that.msg.Id = uid;
let IsOpenMiAi = uni.getStorageSync("basedata") ? let IsOpenMiAi = uni.getStorageSync("basedata")
uni.getStorageSync("basedata").mall.setting.is_show_miai : ? uni.getStorageSync("basedata").mall.setting.is_show_miai
0; //是否开启相亲模式 : 0; //是否开启相亲模式
if (IsOpenMiAi == 0) { if (IsOpenMiAi == 0) {
//不是相亲模式的时候去更新头像和昵称 //不是相亲模式的时候去更新头像和昵称
that.updateuserinfo(that.msg); //更新用户头像 that.updateuserinfo(that.msg); //更新用户头像
...@@ -237,7 +279,8 @@ ...@@ -237,7 +279,8 @@
); );
}, },
updateuserinfo(msg) { updateuserinfo(msg) {
this.request2({ this.request2(
{
url: "/api/MemberUser/SetMemberPhoto", url: "/api/MemberUser/SetMemberPhoto",
data: msg, data: msg,
}, },
...@@ -254,23 +297,17 @@ ...@@ -254,23 +297,17 @@
this.showCoupons = false; this.showCoupons = false;
}, },
updateData() { updateData() {
this.request2({ this.request2(
{
url: "/api/Mall/GetHome", url: "/api/Mall/GetHome",
data: {}, data: {},
}, },
(res) => { (res) => {
uni.setStorageSync("basedata", res.data); uni.setStorageSync("basedata", res.data);
let basedata = uni.getStorageSync("basedata"); let basedata = uni.getStorageSync("basedata");
let isAttestation = 0; let isAttestation = basedata?.user_info?.isAttestation ?? 0;
//basedata?.user_info?.isAttestation ?? 0 let IsOpenGuide =
if (basedata && basedata.user_info && basedata.user_info.isAttestation) { wx.getStorageSync("basedata")?.mall?.setting?.IsOpenGuide ?? 0;
isAttestation = basedata.user_info.isAttestation;
}
let IsOpenGuide = 0;
//wx.getStorageSync("basedata") ? .mall ? .setting ? .IsOpenGuide ? ?
if (basedata && basedata.mall && basedata.mall.setting && basedata.mall.setting.IsOpenGuide) {
IsOpenGuide = basedata.mall.setting.IsOpenGuide
}
if (isAttestation === 0 && IsOpenGuide === 1) { if (isAttestation === 0 && IsOpenGuide === 1) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/user-center/user-center", url: "/pages/user-center/user-center",
...@@ -280,23 +317,23 @@ ...@@ -280,23 +317,23 @@
); );
}, },
}, },
}; };
</script> </script>
<style> <style>
.auth-page img { .auth-page img {
width: 650rpx; width: 650rpx;
height: 700rpx; height: 700rpx;
} }
.auth-page .hotsopt { .auth-page .hotsopt {
position: absolute; position: absolute;
background: transparent; background: transparent;
border: none; border: none;
outline: none; outline: none;
} }
.auth-page .hotsopt::after { .auth-page .hotsopt::after {
border: none; border: none;
} }
</style> </style>
\ No newline at end of file
...@@ -170,16 +170,16 @@ ...@@ -170,16 +170,16 @@
<!-- 价格 --> <!-- 价格 -->
<view :style="{ color: mc }" class="the-price"> <view :style="{ color: mc }" class="the-price">
<text class="small22"></text> <text class="small22"></text>
<text class="numfont22" v-if="g.form_id!=1&&!g.edu_data.BookPrice"> <text class="numfont22" v-if="g.form_id!=1&&g.edu_data&&!g.edu_data.BookPrice">
{{ g.price_min == g.price_max ? g.price_min : g.price_min + '-' + g.price_max }} {{ g.price_min == g.price_max ? g.price_min : g.price_min + '-' + g.price_max }}
</text> </text>
<text class="numfont22" v-if="g.form_id!=1&&g.edu_data.BookPrice"> <text class="numfont22" v-if="g.form_id!=1&&g.edu_data&&g.edu_data.BookPrice">
{{ g.price_min == g.price_max ? parseFloat(g.price_min)+parseFloat(g.edu_data.BookPrice) : g.price_min + '-' + g.price_max }} {{ g.price_min == g.price_max ? parseFloat(g.price_min)+parseFloat(g.edu_data.BookPrice) : g.price_min + '-' + g.price_max }}
</text> </text>
<text class="origin" v-if="g.form_id!=1&&!g.edu_data.BookPrice&& g.jjxkt_original_price && g.jjxkt_original_price > 0 && g.jjxkt_original_price>g.price"> <text class="origin" v-if="g.form_id!=1&&g.edu_data&&!g.edu_data.BookPrice&& g.jjxkt_original_price && g.jjxkt_original_price > 0 && g.jjxkt_original_price>g.price">
¥{{ g.jjxkt_original_price.toFixed(2)}} ¥{{ g.jjxkt_original_price.toFixed(2)}}
</text> </text>
<text class="origin" v-if="g.form_id!=1&& g.edu_data.BookPrice&& g.jjxkt_original_price && g.jjxkt_original_price > 0 && g.jjxkt_original_price>g.price"> <text class="origin" v-if="g.form_id!=1&&g.edu_data&&g.edu_data.BookPrice&& g.jjxkt_original_price && g.jjxkt_original_price > 0 && g.jjxkt_original_price>g.price">
¥{{parseFloat(g.jjxkt_original_price)+parseFloat(g.edu_data.BookPrice)}} ¥{{parseFloat(g.jjxkt_original_price)+parseFloat(g.edu_data.BookPrice)}}
</text> </text>
<!-- <text class="numfont" v-if="g.form_id==1"> <!-- <text class="numfont" v-if="g.form_id==1">
...@@ -349,7 +349,7 @@ ...@@ -349,7 +349,7 @@
<view class="content">{{ g.goods_marketing.limit }}</view> <view class="content">{{ g.goods_marketing.limit }}</view>
</view> </view>
<!-- 优惠 --> <!-- 优惠 -->
<view class="goods-Discount" v-if="g.goodsPreferentialList&& g.goodsPreferentialList.length>0"> <view class="goods-Discount" v-if="g.goodsPreferentialList&&g.goodsPreferentialList.length>0">
<view class="discount-left"> <view class="discount-left">
优惠 优惠
</view> </view>
...@@ -795,8 +795,7 @@ ...@@ -795,8 +795,7 @@
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.g = res.data.goods; this.g = res.data.goods;
// 报名限制数组 // 报名限制数组
if (res.data.goods && res.data.goods.edu_data && res.data.goods.edu_data.ClassCondition) { res.data.goods.edu_data&&res.data.goods.edu_data.ClassCondition&&res.data.goods.edu_data.ClassCondition.forEach(item2 => {
res.data.goods.edu_data.ClassCondition.forEach(item2 => {
if (item2.ItemType == 1) { if (item2.ItemType == 1) {
this.ItemType1.push(item2) this.ItemType1.push(item2)
} else if (item2.ItemType == 2) { } else if (item2.ItemType == 2) {
...@@ -809,8 +808,6 @@ ...@@ -809,8 +808,6 @@
this.ItemType5.push(item2) this.ItemType5.push(item2)
} }
}) })
}
// 报名限制数组结束 // 报名限制数组结束
this.g.totalStock = 0; this.g.totalStock = 0;
this.g.attr.forEach((x) => { this.g.attr.forEach((x) => {
......
...@@ -253,7 +253,7 @@ ...@@ -253,7 +253,7 @@
<view class="content">{{ g.goods_marketing.limit }}</view> <view class="content">{{ g.goods_marketing.limit }}</view>
</view> </view>
<!-- 优惠 --> <!-- 优惠 -->
<view class="goods-Discount" v-if="g.goodsPreferentialList.length>0"> <view class="goods-Discount" v-if="g.goodsPreferentialList&&g.goodsPreferentialList.length>0">
<view class="discount-left"> <view class="discount-left">
优惠 优惠
</view> </view>
......
...@@ -212,7 +212,7 @@ export default { ...@@ -212,7 +212,7 @@ export default {
// 获取小程序APPID // 获取小程序APPID
Vue.prototype.GetMiniAppId = function() { Vue.prototype.GetMiniAppId = function() {
let appObj = {}; let appObj = {};
let appType = 13; let appType = 4;
switch (appType) { switch (appType) {
case 1: //赞羊 case 1: //赞羊
appObj = { appObj = {
......
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