Commit a608cd0e authored by 黄奎's avatar 黄奎

页面修改

parent ecb92346
<template> <template>
<div class="auth-page"> <div class="auth-page">
<u-popup <u-popup v-model="showDialog" mode="center" :mask-close-able="false" custom-style="padding:0;background:none;">
v-model="showDialog" <img :src="pageinfo.pic_url" mode="widthFix" />
mode="center" <button :style="sureStyle" class="hotsopt" open-type="getUserInfo" v-if="canIUseGetUserProfile == false"
:mask-close-able="false" @getuserinfo="showLogin == true ? getoldUser() : ''"></button>
custom-style="padding:0;background:none;" <button :style="sureStyle" class="hotsopt" v-if="canIUseGetUserProfile == true" @tap="showLogin == true ? getUserProfile() : ''"></button>
> <button :style="cancelStyle" class="hotsopt" @click="close"></button>
<img :src="pageinfo.pic_url" mode="widthFix" /> </u-popup>
<button <coupon v-if="showCoupons" :coupon-message="couponMessage" :cform="ComeFrom" @goLook="goLook" @closeBtn="closeBtn"></coupon>
:style="sureStyle" </div>
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>
</u-popup>
<coupon
v-if="showCoupons"
:coupon-message="couponMessage"
:cform="ComeFrom"
@goLook="goLook"
@closeBtn="closeBtn"
></coupon>
</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,
}, },
data() { data() {
return { return {
pageinfo: {}, pageinfo: {},
sureStyle: "", sureStyle: "",
cancelStyle: "", cancelStyle: "",
showDialog: true, showDialog: true,
showCoupons: false, showCoupons: false,
couponMessage: "", couponMessage: "",
ComeFrom: "", ComeFrom: "",
showLogin: true, showLogin: true,
canIUseGetUserProfile: false, canIUseGetUserProfile: false,
msg: {}, msg: {},
}; };
}, },
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; }
} let x = this.pageinfo.hotspot;
let x = this.pageinfo.hotspot; let y = this.pageinfo.hotspot_cancel;
let y = this.pageinfo.hotspot_cancel; this.sureStyle = `height:${x.height}rpx;width:${x.width}rpx;left:${x.left}rpx;top:${x.top}rpx;`;
this.sureStyle = `height:${x.height}rpx;width:${x.width}rpx;left:${x.left}rpx;top:${x.top}rpx;`; this.cancelStyle = `height:${y.height}rpx;width:${y.width}rpx;left:${y.left}rpx;top:${y.top}rpx;`;
this.cancelStyle = `height:${y.height}rpx;width:${y.width}rpx;left:${y.left}rpx;top:${y.top}rpx;`; },
}, methods: {
methods: { getoldUser() {
getoldUser() { //旧的 兼容电脑端
//旧的 兼容电脑端 //4.27注释掉 给予新的提示不能在电脑端登录
//4.27注释掉 给予新的提示不能在电脑端登录 // var that = this;
// var that = this; // uni.login({
// uni.login({ // provider: 'weixin',
// provider: 'weixin', // success: function (loginRes) {
// success: function (loginRes) { // console.log(loginRes.authResult);
// console.log(loginRes.authResult); // // 获取用户信息
// // 获取用户信息 // uni.getUserInfo({
// uni.getUserInfo({ // provider: 'weixin',
// provider: 'weixin', // success: function (infoRes) {
// success: function (infoRes) { // console.log(infoRes,'infoRes')
// console.log(infoRes,'infoRes') // that.getUserInfo(infoRes)
// that.getUserInfo(infoRes) // }
// } // });
// }); // }
// } // });
// }); uni.showToast({
uni.showToast({ title: "电脑端暂时不能获取用户信息,请转到手机端使用!",
title: "电脑端暂时不能获取用户信息,请转到手机端使用!", icon: "none",
icon: "none", });
}); this.showDialog = false;
this.showDialog = false; this.$emit("gbAuth");
this.$emit("gbAuth"); },
}, getUserProfile() {
getUserProfile() { //新的获取用户资料
//新的获取用户资料 var that = this;
var that = this; wx.getUserProfile({
wx.getUserProfile({ desc: "用于完善资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
desc: "用于完善资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 success: (info) => {
success: (info) => { console.log(info);
console.log(info); this.msg = {
this.msg = { Id: 0,
Id: 0, AliasName: info.userInfo.nickName,
AliasName: info.userInfo.nickName, Photo: info.userInfo.avatarUrl,
Photo: info.userInfo.avatarUrl, };
}; that.getUserInfo(info);
that.getUserInfo(info); },
}, fail: () => {
fail: () => { uni.showToast({
uni.showToast({ title: "微信登录授权失败",
title: "微信登录授权失败", icon: "none",
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) => { //这里请求接口
//这里请求接口 let obj = {
let obj = { Source: 1,
Source: 1, OpenId: "",
OpenId: "", Name: info.userInfo.nickName,
Name: info.userInfo.nickName, Photo: info.userInfo.avatarUrl,
Photo: info.userInfo.avatarUrl, Gender: info.userInfo.gender,
Gender: info.userInfo.gender, Moblie: "",
Moblie: "", SuperiorId: 0,
SuperiorId: 0, code: res.code,
code: res.code, };
}; that.getCode(obj);
that.getCode(obj); },
}, fail: () => {
fail: () => { uni.showToast({
uni.showToast({ title: "微信登录授权失败",
title: "微信登录授权失败", icon: "none",
icon: "none", });
}); },
}, });
}); } else {
} else { uni.showToast({
uni.showToast({ title: "请先安装微信或升级版本",
title: "请先安装微信或升级版本", icon: "none",
icon: "none", });
}); }
} },
}, });
}); },
}, close() {
close() { this.showDialog = false;
this.showDialog = false; this.$emit("gbAuth");
this.$emit("gbAuth"); },
}, //调用获取code
//调用获取code getCode(obj) {
getCode(obj) { var that = this;
var that = this; uni.showLoading({
uni.showLoading({ title: "登录中",
title: "登录中", });
}); //这里请求接口
//这里请求接口 var OpenId = "";
var OpenId = ""; that.request2({
that.request2( url: "/api/mall/GetWeChatOpenId",
{ data: {
url: "/api/mall/GetWeChatOpenId", Code: obj.code,
data: { },
Code: obj.code, },
}, (res) => {
}, if (res.resultCode == 1) {
(res) => { obj.OpenId = res.data;
if (res.resultCode == 1) { that.getLogin(obj);
obj.OpenId = res.data; }
that.getLogin(obj); }
} );
} },
); //登录
}, getLogin(obj) {
//登录 var that = this;
getLogin(obj) { that.showLogin = false;
var that = this;
that.showLogin = false;
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, OpenId: obj.OpenId,
OpenId: obj.OpenId, Name: obj.Name,
Name: obj.Name, Photo: obj.Photo,
Photo: obj.Photo, Gender: obj.Gender,
Gender: obj.Gender, Moblie: "",
Moblie: "", SuperiorId: pid,
SuperiorId: pid, SmallShopId: SmallShopId,
SmallShopId: SmallShopId, UserPageType: Up,
UserPageType: Up, CounponPassword: CounponPassword,
CounponPassword: CounponPassword, KeyWord: KeyWord,
KeyWord: KeyWord, EduSchoolId: EduSchoolId,
EduSchoolId: EduSchoolId, EduId: EduId
EduId:EduId },
}, },
}, (res) => {
(res) => { console.log(186, EduSchoolId);
console.log(186, EduSchoolId); uni.hideLoading();
uni.hideLoading(); that.showLogin = true; //防止多次点击登录
that.showLogin = true; //防止多次点击登录 if (res.resultCode == 1) {
if (res.resultCode == 1) { this.showDialog = false;
this.showDialog = false; uni.setStorageSync("mall_UserInfo", res.data);
uni.setStorageSync("mall_UserInfo", res.data); that.$emit("changeuserinfo");
that.$emit("changeuserinfo"); // ----------橙霜---------------
// ----------橙霜--------------- let AppletID = this.GetMiniAppId().TenantId;
let AppletID = this.GetMiniAppId().TenantId; if (AppletID === 24) {
if (AppletID === 24) { this.updateData();
this.updateData(); }
} // --------------------------------
// -------------------------------- if (res.couponResultCode == 1) {
if (res.couponResultCode == 1) { if (uni.getStorageSync("ComeFrom")) {
if (uni.getStorageSync("ComeFrom")) { that.ComeFrom = uni.getStorageSync("ComeFrom").ComeFrom;
that.ComeFrom = uni.getStorageSync("ComeFrom").ComeFrom; }
} that.showCoupons = true;
that.showCoupons = true; that.couponMessage = res.couponMessage;
that.couponMessage = res.couponMessage; }
} uni.removeStorageSync("pid");
uni.removeStorageSync("pid"); uni.removeStorageSync("SmallShopId");
uni.removeStorageSync("SmallShopId"); uni.removeStorageSync("Up");
uni.removeStorageSync("Up"); uni.removeStorageSync("CounponPassword");
uni.removeStorageSync("CounponPassword"); uni.removeStorageSync("KeyWord");
uni.removeStorageSync("KeyWord"); 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); //更新用户头像 }
} }
} }
} );
); },
}, updateuserinfo(msg) {
updateuserinfo(msg) { this.request2({
this.request2( url: "/api/MemberUser/SetMemberPhoto",
{ data: msg,
url: "/api/MemberUser/SetMemberPhoto", },
data: msg, (res) => {
}, //静默处理不做任何提示
(res) => { },
//静默处理不做任何提示 (error) => {}
}, );
(error) => {} },
); goLook() {
}, this.showCoupons = false;
goLook() { },
this.showCoupons = false; closeBtn() {
}, this.showCoupons = false;
closeBtn() { },
this.showCoupons = false; updateData() {
}, this.request2({
updateData() { url: "/api/Mall/GetHome",
this.request2( data: {},
{ },
url: "/api/Mall/GetHome", (res) => {
data: {}, uni.setStorageSync("basedata", res.data);
}, let basedata = uni.getStorageSync("basedata");
(res) => { let isAttestation = 0;
uni.setStorageSync("basedata", res.data); //basedata?.user_info?.isAttestation ?? 0
let basedata = uni.getStorageSync("basedata"); if (basedata && basedata.user_info && basedata.user_info.isAttestation) {
let isAttestation = basedata?.user_info?.isAttestation ?? 0; isAttestation = basedata.user_info.isAttestation;
let IsOpenGuide = }
wx.getStorageSync("basedata")?.mall?.setting?.IsOpenGuide ?? 0; let IsOpenGuide = 0;
if (isAttestation === 0 && IsOpenGuide === 1) { //wx.getStorageSync("basedata") ? .mall ? .setting ? .IsOpenGuide ? ?
uni.navigateTo({ if (basedata && basedata.mall && basedata.mall.setting && basedata.mall.setting.IsOpenGuide) {
url: "/pages/user-center/user-center", IsOpenGuide = basedata.mall.setting.IsOpenGuide
}); }
} if (isAttestation === 0 && IsOpenGuide === 1) {
} uni.navigateTo({
); url: "/pages/user-center/user-center",
}, });
}, }
}; }
);
},
},
};
</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
...@@ -9,14 +9,14 @@ ...@@ -9,14 +9,14 @@
<text class="small"></text> <text class="small"></text>
<text>{{ goodprice }}</text> <text>{{ goodprice }}</text>
</view> </view>
<view class="amount">{{g.form_id ==1?'余位':'库存'}} {{ goodamount }} {{ g.unit }}</view> <view class="amount">{{g.form_id ==1?'余位':'库存'}} {{ goodamount }} {{ g.unit }}</view>
<view class="sku">{{ skuObj ? '已选择' : '选择' }} {{ sku }}</view> <view class="sku">{{ skuObj ? '已选择' : '选择' }} {{ sku }}</view>
<view class="sku_close"> <view class="sku_close">
<u-icon name="cross" color="#9F9F9F" @click="cloGood()" size="40" /> <u-icon name="cross" color="#9F9F9F" @click="cloGood()" size="40" />
</view> </view>
</view> </view>
</view> </view>
<scroll-view scroll-y class="sku-box"> <scroll-view scroll-y class="sku-box">
<view class="sku-item" v-for="(x, i) in g.attr_groups" :key="i"> <view class="sku-item" v-for="(x, i) in g.attr_groups" :key="i">
<view class="sku-title">{{ x.attr_group_name }}</view> <view class="sku-title">{{ x.attr_group_name }}</view>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<text class="label">购买数量</text> <text class="label">购买数量</text>
<u-number-box :disabled="!skuObj" v-model="gc" :min="1" :max="goodamount" @change="valChange"></u-number-box> <u-number-box :disabled="!skuObj" v-model="gc" :min="1" :max="goodamount" @change="valChange"></u-number-box>
</view> </view>
<view class="btn-box" v-if="g.totalStock>0&& g.status==1 && (g.form_id == -1 || g.form_id ==0)"> <view class="btn-box" v-if="g.totalStock>0&& g.status==1 && (g.form_id == -1 || g.form_id ==0 ||g.form_id>1)">
<view style="flex: 1;" v-if="optionType != 1"> <view style="flex: 1;" v-if="optionType != 1">
<u-button @click="joinCar" :ripple="true" :hair-line="false" :custom-style="btn1">加入购物车</u-button> <u-button @click="joinCar" :ripple="true" :hair-line="false" :custom-style="btn1">加入购物车</u-button>
</view> </view>
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
<u-button @click="buy" :ripple="true" :hair-line="false" :custom-style="btn2">立即购买</u-button> <u-button @click="buy" :ripple="true" :hair-line="false" :custom-style="btn2">立即购买</u-button>
</view> </view>
</view> </view>
<!--教育-->
<view class="btn-box" v-if="g.totalStock>0&& g.status==1 && g.form_id ==1"> <view class="btn-box" v-if="g.totalStock>0&& g.status==1 && g.form_id ==1">
<view style="flex: 1;"> <view style="flex: 1;">
<u-button :ripple="true" :hair-line="false" :custom-style="btn4" @click='signup'>立即报名5</u-button> <u-button :ripple="true" :hair-line="false" :custom-style="btn4" @click='signup'>立即报名5</u-button>
...@@ -321,7 +322,7 @@ ...@@ -321,7 +322,7 @@
}); });
} }
}, },
signup(){//教育报名 signup() { //教育报名
let ShoppingCartIdList = []; let ShoppingCartIdList = [];
if (this.skuObj && this.skuObj.id) { if (this.skuObj && this.skuObj.id) {
let good = { let good = {
...@@ -499,6 +500,7 @@ ...@@ -499,6 +500,7 @@
text-decoration: line-through; text-decoration: line-through;
margin-left: 10rpx; margin-left: 10rpx;
} }
.goodsku { .goodsku {
position: relative; position: relative;
padding: 10px; padding: 10px;
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
"quickapp" : {}, "quickapp" : {},
/* 小程序特有相关 */ /* 小程序特有相关 */
"mp-weixin" : { "mp-weixin" : {
"appid" : "wx5349e63aea0c8529", "appid" : "wx5564525562e92ddb",
"setting" : { "setting" : {
"urlCheck" : false, "urlCheck" : false,
"minified" : false "minified" : false
......
...@@ -177,10 +177,10 @@ ...@@ -177,10 +177,10 @@
{{ 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.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.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">
{{ g.price_min }} {{ g.price_min }}
...@@ -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.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,19 +795,22 @@ ...@@ -795,19 +795,22 @@
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.g = res.data.goods; this.g = res.data.goods;
// 报名限制数组 // 报名限制数组
res.data.goods.edu_data.ClassCondition.forEach(item2 => { if (res.data.goods && res.data.goods.edu_data && res.data.goods.edu_data.ClassCondition) {
if (item2.ItemType == 1) { res.data.goods.edu_data.ClassCondition.forEach(item2 => {
this.ItemType1.push(item2) if (item2.ItemType == 1) {
} else if (item2.ItemType == 2) { this.ItemType1.push(item2)
this.ItemType2.push(item2) } else if (item2.ItemType == 2) {
} else if (item2.ItemType == 3) { this.ItemType2.push(item2)
this.ItemType3.push(item2) } else if (item2.ItemType == 3) {
} else if (item2.ItemType == 4) { this.ItemType3.push(item2)
this.ItemType4.push(item2) } else if (item2.ItemType == 4) {
} else if (item2.ItemType == 5) { this.ItemType4.push(item2)
this.ItemType5.push(item2) } else if (item2.ItemType == 5) {
} this.ItemType5.push(item2)
}) }
})
}
// 报名限制数组结束 // 报名限制数组结束
this.g.totalStock = 0; this.g.totalStock = 0;
this.g.attr.forEach((x) => { this.g.attr.forEach((x) => {
......
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