提交
This commit is contained in:
parent
94023be5b4
commit
9e4b34e4b2
|
|
@ -8,7 +8,7 @@ import RequestManager from '@/common/request.js'
|
|||
let configData = null;
|
||||
let isLoading = false;
|
||||
let loadPromise = null;
|
||||
const wx_version = "100";
|
||||
const wx_version = "103";
|
||||
const defaultConfig = {
|
||||
"good_type": [{ "value": 0, "sort_order": 0, "is_show": 1, "name": "全部", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 1, "sort_order": 1, "is_show": 0, "name": "一番赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 2, "sort_order": 2, "is_show": 1, "name": "无限赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 3, "sort_order": 3, "is_show": 0, "name": "擂台赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 5, "sort_order": 4, "is_show": 0, "name": "积分赏", "pay_wechat": 0, "pay_balance": 0, "pay_currency": 0, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 0 }, { "value": 6, "sort_order": 5, "is_show": 1, "name": "限时活动", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 8, "sort_order": 6, "is_show": 1, "name": "领主赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 9, "sort_order": 7, "is_show": 0, "name": "连击赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 10, "sort_order": 8, "is_show": 0, "name": "商城赏", "pay_wechat": 1, "pay_balance": 0, "pay_currency": 0, "pay_currency2": 1, "pay_coupon": 0, "is_deduction": 0 }, { "value": 11, "sort_order": 9, "is_show": 0, "name": "自制赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 15, "sort_order": 15, "is_show": 0, "name": "福利屋", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 0, "pay_currency2": 0, "pay_coupon": 0, "is_deduction": 0 }, { "value": 16, "sort_order": 16, "is_show": 1, "name": "翻倍赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 17, "sort_order": 17, "is_show": 0, "name": "外卖盒子", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 0, "pay_currency2": 0, "pay_coupon": 0, "is_deduction": 0 }],
|
||||
"app_setting": {
|
||||
|
|
@ -31,7 +31,7 @@ const defaultConfig = {
|
|||
"daily_coupon_limit": "0",
|
||||
"update_time": 1744550962
|
||||
},
|
||||
version: "100"
|
||||
version: wx_version
|
||||
};
|
||||
|
||||
// 配置类
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@
|
|||
|
||||
<rule-pop ref="appNotice" notice-check></rule-pop>
|
||||
|
||||
<float-ball></float-ball>
|
||||
<float-ball v-if="!$config.GetVersion()"></float-ball>
|
||||
|
||||
<!-- #ifdef MP -->
|
||||
<!-- 隐私政策弹窗 -->
|
||||
|
|
@ -327,24 +327,7 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
// colrdo() {
|
||||
// //插入一条弹幕
|
||||
// let that = this
|
||||
// let a = 0
|
||||
// that.timer = setInterval(function () {
|
||||
// // that.$refs.lffBarrage.add({
|
||||
// // item: that.notice_list[a].content,
|
||||
// // // title: that.notice_list[a].title,
|
||||
// // // color: that.notice_list[a].color,
|
||||
// // headimg: that.notice_list[a].headimg
|
||||
// // });
|
||||
// if (a < that.notice_list.length - 1) {
|
||||
// a++
|
||||
// } else {
|
||||
// a = 0
|
||||
// }
|
||||
// }, 5000)
|
||||
// },
|
||||
|
||||
torili() {
|
||||
uni.setStorageSync("rili", this.yushou_rili);
|
||||
this.gotoPage("/pages/shouye/rili");
|
||||
|
|
@ -388,9 +371,7 @@ export default {
|
|||
keyword: that.keyword,
|
||||
},
|
||||
success: function (res) {
|
||||
that.mescroll.endByPage(res.data.data.length, res.data.last_page);
|
||||
console.log(res.data.data, "res.data.data");
|
||||
|
||||
|
||||
let _data = res.data.data;
|
||||
let isWXPay = that.$config.GetVersion()
|
||||
if (isWXPay) {
|
||||
|
|
@ -402,6 +383,7 @@ export default {
|
|||
}
|
||||
_data = _data2;
|
||||
}
|
||||
that.mescroll.endByPage(_data.length, res.data.last_page);
|
||||
if (num == 1) {
|
||||
that.listdata = _data;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -44,277 +44,291 @@
|
|||
<text>授权登录</text>
|
||||
</button>
|
||||
</view>
|
||||
<view style="font-size: 20rpx;color: #979797;position: fixed;bottom: 20rpx;right:47rpx;">version:v1.0.3
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
z_imgPath: this.$z_img2,
|
||||
SessionKey: '',
|
||||
OpenId: '',
|
||||
nickName: null,
|
||||
avatarUrl: null,
|
||||
isCanUse: uni.getStorageSync('isCanUse') || true, //默认为true
|
||||
code: '',
|
||||
isAgree: false
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
z_imgPath: this.$z_img2,
|
||||
SessionKey: '',
|
||||
OpenId: '',
|
||||
nickName: null,
|
||||
avatarUrl: null,
|
||||
isCanUse: uni.getStorageSync('isCanUse') || true, //默认为true
|
||||
code: '',
|
||||
isAgree: false
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
//默认加载
|
||||
// this.login();
|
||||
// console.log(window.location.href, option);
|
||||
if (option != null) {
|
||||
if (option.code != null) {
|
||||
//登录
|
||||
// this.h5Login(option.code);
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
//默认加载
|
||||
// this.login();
|
||||
// console.log(window.location.href, option);
|
||||
if (option != null) {
|
||||
if (option.code != null) {
|
||||
//登录
|
||||
this.h5Login(option.code);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//第一授权获取用户信息===》按钮触发
|
||||
getUserProfile(e) {
|
||||
if (!this.isAgree) {
|
||||
return this.$c.toast({
|
||||
title: '请阅读并同意《用户协议》和《隐私政策》'
|
||||
})
|
||||
}
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
this.wxUserProfile();
|
||||
// #endif
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
//第一授权获取用户信息===》按钮触发
|
||||
getUserProfile(e) {
|
||||
if (!this.isAgree) {
|
||||
return this.$c.toast({
|
||||
title: '请阅读并同意《用户协议》和《隐私政策》'
|
||||
})
|
||||
}
|
||||
// #ifdef H5
|
||||
this.h5UserProfile();
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
this.wxUserProfile();
|
||||
// #endif
|
||||
|
||||
|
||||
},
|
||||
wxUserProfile() {
|
||||
var that = this
|
||||
uni.getUserProfile({
|
||||
desc: '用于向用户发送商品', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
|
||||
lang: 'zh_CN',
|
||||
success: res => {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: function(loginRes) {
|
||||
that.req({
|
||||
url: 'login',
|
||||
data: {
|
||||
code: loginRes.code,
|
||||
nickname: res.userInfo.nickName,
|
||||
headimg: res.userInfo.avatarUrl,
|
||||
pid: uni.getStorageSync('pid')
|
||||
},
|
||||
success: function(res) {
|
||||
if (res.status == 1) {
|
||||
uni.setStorageSync('token', res.data)
|
||||
var lgurl = uni.getStorageSync(
|
||||
'lgurl') //获取页面路径
|
||||
var lgdata = uni.getStorageSync(
|
||||
'lgurldata') //获取页面参数
|
||||
if (lgurl) {
|
||||
lgdata = JSON.parse(lgdata)
|
||||
// 拼接参数
|
||||
let param = ''
|
||||
for (let key in lgdata) {
|
||||
param += '&' + key + '=' + lgdata[
|
||||
key]
|
||||
}
|
||||
param = '/' + lgurl + param.replace(
|
||||
'&', '?')
|
||||
uni.setStorageSync('lgurl', '')
|
||||
uni.setStorageSync('lgurldata', '')
|
||||
console.log(param)
|
||||
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: param
|
||||
})
|
||||
}, 1000)
|
||||
} else {
|
||||
that.getdata();
|
||||
// uni.reLaunch({
|
||||
// url: 'index'
|
||||
// })
|
||||
wxUserProfile() {
|
||||
var that = this
|
||||
uni.getUserProfile({
|
||||
desc: '用于向用户发送商品', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
|
||||
lang: 'zh_CN',
|
||||
success: res => {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: function (loginRes) {
|
||||
that.req({
|
||||
url: 'login',
|
||||
data: {
|
||||
code: loginRes.code,
|
||||
nickname: '',
|
||||
headimg: '',
|
||||
pid: uni.getStorageSync('pid')
|
||||
},
|
||||
success: function (res) {
|
||||
if (res.status == 1) {
|
||||
uni.setStorageSync('token', res.data)
|
||||
that.$c.msg("登录成功")
|
||||
var lgurl = uni.getStorageSync('lgurl') //获取页面路径
|
||||
var lgdata = uni.getStorageSync('lgurldata') //获取页面参数
|
||||
if (lgurl) {
|
||||
lgdata = JSON.parse(lgdata)
|
||||
// 拼接参数
|
||||
let param = ''
|
||||
for (let key in lgdata) {
|
||||
param += '&' + key + '=' + lgdata[
|
||||
key]
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
complete: (e) => {
|
||||
console.log(e, '登录');
|
||||
}
|
||||
})
|
||||
},
|
||||
complete: (e) => {
|
||||
console.log(e, '用于向用户发送商品');
|
||||
}
|
||||
})
|
||||
param = '/' + lgurl + param.replace(
|
||||
'&', '?')
|
||||
uni.setStorageSync('lgurl', '')
|
||||
uni.setStorageSync('lgurldata', '')
|
||||
console.log(param)
|
||||
|
||||
},
|
||||
h5Login(code) {
|
||||
var that = this;
|
||||
that.req({
|
||||
url: 'h5login',
|
||||
data: {
|
||||
code: code,
|
||||
pid: uni.getStorageSync('pid')
|
||||
},
|
||||
success: function(res) {
|
||||
if (res.status == 1) {
|
||||
uni.setStorageSync('token', res.data)
|
||||
var lgurl = uni.getStorageSync(
|
||||
'lgurl') //获取页面路径
|
||||
var lgdata = uni.getStorageSync(
|
||||
'lgurldata') //获取页面参数
|
||||
if (lgurl) {
|
||||
lgdata = JSON.parse(lgdata)
|
||||
// 拼接参数
|
||||
let param = ''
|
||||
for (let key in lgdata) {
|
||||
param += '&' + key + '=' + lgdata[
|
||||
key]
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: param
|
||||
})
|
||||
}, 1000)
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
that.getdata();
|
||||
}, 1000)
|
||||
|
||||
// uni.reLaunch({
|
||||
// url: 'index'
|
||||
// })
|
||||
}
|
||||
} else {
|
||||
that.$c.msg("登录失败!" + res.msg)
|
||||
}
|
||||
}
|
||||
param = '/' + lgurl + param.replace(
|
||||
'&', '?')
|
||||
uni.setStorageSync('lgurl', '')
|
||||
uni.setStorageSync('lgurldata', '')
|
||||
console.log(param)
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: param
|
||||
})
|
||||
}, 1000)
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: 'index'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
h5UserProfile() {
|
||||
var that = this;
|
||||
console.log('进入h5')
|
||||
this.$c.msg('暂未开放登录');
|
||||
// window.location.href = this.$wxloginPage;
|
||||
},
|
||||
getdata() {
|
||||
let that = this
|
||||
that.req({
|
||||
url: 'user',
|
||||
success(res) {
|
||||
if (res.status == 1 && res.data.userinfo != null && res.data.userinfo.mobile_is == 0) {
|
||||
console.log("判断用户有没有手机号", res.data.userinfo.mobile_is);
|
||||
uni.reLaunch({
|
||||
url: 'bangding'
|
||||
})
|
||||
},
|
||||
fail: (e) => {
|
||||
that.$c.msg("登录失败,网络错误!" + e.msg)
|
||||
console.log(e, '登录失败', e);
|
||||
|
||||
},
|
||||
complete: (e) => {
|
||||
console.log(e, '登录');
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: (e) => {
|
||||
that.$c.msg("登录失败,申请获取微信用户数据失败")
|
||||
console.log(e, '获取微信用户数据失败');
|
||||
|
||||
},
|
||||
complete: (e) => {
|
||||
console.log(e, '用于向用户发送商品');
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
h5Login(code) {
|
||||
var that = this;
|
||||
that.req({
|
||||
url: 'h5login',
|
||||
data: {
|
||||
code: code,
|
||||
pid: uni.getStorageSync('pid')
|
||||
},
|
||||
success: function (res) {
|
||||
if (res.status == 1) {
|
||||
uni.setStorageSync('token', res.data)
|
||||
var lgurl = uni.getStorageSync(
|
||||
'lgurl') //获取页面路径
|
||||
var lgdata = uni.getStorageSync(
|
||||
'lgurldata') //获取页面参数
|
||||
if (lgurl) {
|
||||
lgdata = JSON.parse(lgdata)
|
||||
// 拼接参数
|
||||
let param = ''
|
||||
for (let key in lgdata) {
|
||||
param += '&' + key + '=' + lgdata[
|
||||
key]
|
||||
}
|
||||
param = '/' + lgurl + param.replace(
|
||||
'&', '?')
|
||||
uni.setStorageSync('lgurl', '')
|
||||
uni.setStorageSync('lgurldata', '')
|
||||
console.log(param)
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: param
|
||||
})
|
||||
}, 1000)
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: 'index'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
h5UserProfile() {
|
||||
var that = this;
|
||||
console.log('进入h5')
|
||||
this.$c.msg('暂未开放登录');
|
||||
// window.location.href = this.$wxloginPage;
|
||||
},
|
||||
getdata() {
|
||||
let that = this
|
||||
that.req({
|
||||
url: 'user',
|
||||
success(res) {
|
||||
if (res.status == 1 && res.data.userinfo != null && res.data.userinfo.mobile_is == 0) {
|
||||
console.log("判断用户有没有手机号", res.data.userinfo.mobile_is);
|
||||
uni.reLaunch({
|
||||
url: 'bangding'
|
||||
})
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: 'index'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.all {
|
||||
min-height: 100vh;
|
||||
background-color: #FFFFFF;
|
||||
// background: url($imgurl+'common/pageBg1.png') no-repeat 0 0 / 100% auto;
|
||||
.all {
|
||||
min-height: 100vh;
|
||||
background-color: #FFFFFF;
|
||||
// background: url($imgurl+'common/pageBg1.png') no-repeat 0 0 / 100% auto;
|
||||
}
|
||||
|
||||
.header {
|
||||
margin: 0 0 90rpx 50rpx;
|
||||
padding: 90rpx 0 0;
|
||||
border-bottom: 1px solid #E8E8E8;
|
||||
text-align: center;
|
||||
width: 650rpx;
|
||||
height: 300rpx;
|
||||
line-height: 450rpx;
|
||||
}
|
||||
|
||||
.header image {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-left: 50rpx;
|
||||
margin-bottom: 90rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.content text {
|
||||
display: block;
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
|
||||
.agree {
|
||||
display: flex;
|
||||
padding: 0 50rpx;
|
||||
|
||||
.icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.header {
|
||||
margin: 0 0 90rpx 50rpx;
|
||||
padding: 90rpx 0 0;
|
||||
border-bottom: 1px solid #E8E8E8;
|
||||
text-align: center;
|
||||
width: 650rpx;
|
||||
height: 300rpx;
|
||||
line-height: 450rpx;
|
||||
}
|
||||
.agree-r {
|
||||
flex: 1;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
padding-left: 20rpx;
|
||||
line-height: 32rpx;
|
||||
|
||||
.header image {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
font-size: 20rpx;
|
||||
color: #999999;
|
||||
|
||||
.content {
|
||||
margin-left: 50rpx;
|
||||
margin-bottom: 90rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.content text {
|
||||
display: block;
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
|
||||
.agree {
|
||||
display: flex;
|
||||
padding: 0 50rpx;
|
||||
|
||||
.icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.agree-r {
|
||||
flex: 1;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
padding-left: 20rpx;
|
||||
line-height: 32rpx;
|
||||
|
||||
font-size: 20rpx;
|
||||
color: #999999;
|
||||
|
||||
text {
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn-list {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
padding: 50rpx 0 0;
|
||||
|
||||
.cancel {
|
||||
width: 200rpx;
|
||||
height: 80rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 16rpx;
|
||||
font-size: 28rpx;
|
||||
text {
|
||||
color: #333333;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: #CDEF27;
|
||||
// filter: grayscale(1);
|
||||
}
|
||||
|
||||
.bottom {
|
||||
background: #333333;
|
||||
margin: 0;
|
||||
width: 416rpx;
|
||||
height: 80rpx;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
border-radius: 16rpx;
|
||||
font-size: 28rpx;
|
||||
color: #CDEF27;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn-list {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
padding: 50rpx 0 0;
|
||||
|
||||
.cancel {
|
||||
width: 200rpx;
|
||||
height: 80rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 16rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: #CDEF27;
|
||||
// filter: grayscale(1);
|
||||
}
|
||||
|
||||
.bottom {
|
||||
background: #333333;
|
||||
margin: 0;
|
||||
width: 416rpx;
|
||||
height: 80rpx;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
border-radius: 16rpx;
|
||||
font-size: 28rpx;
|
||||
color: #CDEF27;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user