This commit is contained in:
zpc 2024-07-24 15:15:56 +08:00
parent d0970d0f07
commit 12793f06cc
12 changed files with 811 additions and 308 deletions

252
App.vue
View File

@ -1,146 +1,156 @@
<script>
import Vue from 'vue'
import Vue from 'vue'
export default {
onLaunch: function () {
console.log('App Launch')
export default {
onLaunch: function() {
console.log('App Launch')
const openBgm = uni.createInnerAudioContext()
Vue.prototype.bgmCtx = {}
Vue.prototype.bgmCtx.openBgm = openBgm
openBgm.src = this.$img('/static/mp3/open.mp3')
/* 重置首页公告弹窗状态 */
uni.setStorageSync('_is_this_show', false)
const openBgm = uni.createInnerAudioContext()
Vue.prototype.bgmCtx = {}
Vue.prototype.bgmCtx.openBgm = openBgm
openBgm.src = this.$img('/static/mp3/open.mp3')
/* 重置首页公告弹窗状态 */
uni.setStorageSync('_is_this_show', false)
/* 清除缓存中的广告id */
uni.removeStorageSync('_ad_id')
/* 清除缓存中的click_id */
uni.removeStorageSync('_click_id')
},
onShow: function () {
console.log('App Show')
/* 清除缓存中的广告id */
uni.removeStorageSync('_ad_id')
/* 清除缓存中的click_id */
uni.removeStorageSync('_click_id')
},
onShow: function() {
console.log('App Show')
},
onHide: function () {
console.log('App Hide')
},
onHide: function() {
console.log('App Hide')
}
}
}
}
</script>
<style lang="scss">
/*每个页面公共css */
@import './common/animate.css';
@import url('./common/common.css');
@import url('/components/gaoyia-parse/parse.css');
/*每个页面公共css */
@import './common/animate.css';
@import url('./common/common.css');
@import url('/components/gaoyia-parse/parse.css');
/* 引入字体 */
@font-face {
font-family: 'YouSheBiaoTiHei';
src: url($imgurl +'font/YouSheBiaoTiHei.ttf') format('truetype');
}
/* 引入字体 */
@font-face {
font-family: 'YouSheBiaoTiHei';
src: url($imgurl +'font/YouSheBiaoTiHei.ttf') format('truetype');
}
@font-face {
font-family: 'zihun152hao-jijiachaojihei';
src: url($imgurl+'font/zihun152hao-jijiachaojihei.TTF') format('truetype');
}
@font-face {
font-family: 'zihun152hao-jijiachaojihei';
src: url($imgurl+'font/zihun152hao-jijiachaojihei.TTF') format('truetype');
}
@font-face {
font-family: 'zihun147hao-xingyuanhei';
src: url($imgurl+'font/zihun147hao-xingyuanhei.TTF') format('truetype');
}
@font-face {
font-family: 'zihun147hao-xingyuanhei';
src: url($imgurl+'font/zihun147hao-xingyuanhei.TTF') format('truetype');
}
page {
overflow-x: hidden;
page {
overflow-x: hidden;
&:before {
content: '';
position: fixed;
z-index: -1;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: #1C1B20;
}
}
.ziti{
font-family: YouSheBiaoTiHei;
}
.flex_center {
display: flex;
align-items: center;
}
&:before {
content: '';
position: fixed;
z-index: -1;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: #1C1B20;
}
}
.hang2 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
word-wrap: break-word;
word-break: break-all;
}
.ziti {
font-family: YouSheBiaoTiHei;
}
.hang1 {
overflow: hidden;
/*超出部分隐藏*/
white-space: nowrap;
/*不换行*/
text-overflow: ellipsis;
/*超出部分文字以...显示*/
}
.flex_center {
display: flex;
align-items: center;
}
.icon {
display: flex;
justify-content: center;
align-items: center;
.hang2 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
word-wrap: break-word;
word-break: break-all;
}
image {
width: 100%;
height: 100%;
}
}
.hang1 {
overflow: hidden;
/*超出部分隐藏*/
white-space: nowrap;
/*不换行*/
text-overflow: ellipsis;
/*超出部分文字以...显示*/
}
.common_bg {
background-repeat: no-repeat;
background-position: 0 0;
background-size: 100% 100%;
}
.icon {
display: flex;
justify-content: center;
align-items: center;
.relative {
position: relative;
}
image {
width: 100%;
height: 100%;
}
}
button.hide {
position: absolute;
width: 100% !important;
height: 100% !important;
left: 0;
top: 0;
z-index: 1;
opacity: 0;
}
.common_bg {
background-repeat: no-repeat;
background-position: 0 0;
background-size: 100% 100%;
}
/* 重写组件样式 */
/deep/.uni-noticebar {
padding: 0 !important;
margin: 0 !important;
}
.relative {
position: relative;
}
/deep/.mescroll-upwarp {
box-sizing: border-box;
min-height: 55px;
padding: 15px 0;
text-align: center;
clear: both;
}
button.hide {
position: absolute;
width: 100% !important;
height: 100% !important;
left: 0;
top: 0;
z-index: 1;
opacity: 0;
}
/deep/.cmd-progress-outer {
line-height: 0;
/* 重写组件样式 */
/deep/.uni-noticebar {
padding: 0 !important;
margin: 0 !important;
}
.cmd-progress-bg {
margin: 0 !important;
}
}
</style>
/deep/.mescroll-upwarp {
box-sizing: border-box;
min-height: 55px;
padding: 15px 0;
text-align: center;
clear: both;
}
/deep/.cmd-progress-outer {
line-height: 0;
.cmd-progress-bg {
margin: 0 !important;
}
}
.uni-tabbar__bd {
height: 50px !important;
}
.uni-tabbar__icon {
height: 50px !important;
}
</style>

View File

@ -117,6 +117,43 @@ export default {
*/
wxMpPay({ provider = 'weixin', data }) {
console.log('wxdata', data)
// #ifdef H5
console.log('进入h5支付', data)
return new Promise((resolve, reject) => {
WeixinJSBridge.invoke(
'getBrandWCPayRequest', data,
function (res) {
console.log('支付回调', res);
if (res.errMsg == 'requestPayment:fail cancel') {
uni.showToast({
title: '取消支付',
icon: 'none',
duration: 500,
success: () => {
/* 取消订单 */
}
})
resolve('cancel')
}
if (res.err_msg == "get_brand_wcpay_request:ok") {
// 使用以上方式判断前端返回,微信团队郑重提示:
//res.err_msg将在用户支付成功后返回ok但并不保证它绝对可靠。
uni.showToast({
title: '支付成功',
icon: 'success',
duration: 500,
success: () => {
resolve('success')
}
})
}
});
})
// #endif
// #ifdef MP-WEIXIN
return new Promise((resolve, reject) => {
uni.requestPayment({
provider,
@ -154,6 +191,8 @@ export default {
}
})
})
// #endif
},
/**
@ -367,24 +406,24 @@ export default {
*/
filterText(val) {
if (val) {
var replaceLbael = val.replace(/<[^>]+>/g,'')
return replaceLbael.replace(/&nbsp;/ig,'')
var replaceLbael = val.replace(/<[^>]+>/g, '')
return replaceLbael.replace(/&nbsp;/ig, '')
} else {
return ''
}
},
// 返回上一页
$navBack(num = 1, time = 0) {
// 页面返回
setTimeout(() => {
uni.navigateBack({
delta: num,
fail: () => {
uni.reLaunch({
url: '/pages/shouye/index'
})
}
})
}, time * 1000)
// 页面返回
setTimeout(() => {
uni.navigateBack({
delta: num,
fail: () => {
uni.reLaunch({
url: '/pages/shouye/index'
})
}
})
}, time * 1000)
},
}

333
main.js
View File

@ -3,7 +3,9 @@ import App from './App'
import Mixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js'
// import uView from "uview-ui"
import { gotopage } from '@/common/gotopage.js'
import {
gotopage
} from '@/common/gotopage.js'
// 配置公共方法
Vue.prototype.gotoPage = gotopage
@ -11,154 +13,197 @@ Vue.prototype.gotoPage = gotopage
// 配置公共方法
import common from '@/common/common.js'
Vue.prototype.$noMultipleClicks = common.noMultipleClicks
Vue.prototype.$c = common
Vue.prototype.$c = common;
// var loginPage="http://api.zpc-xy.com/login.html";
var loginPage="http://api.zpc-xy.com/login.html";
// var loginPage="https://xinglanmh.shequtuangou.vip/login.html";
Vue.prototype.$loginPage = loginPage;
Vue.prototype.$wxloginPage =`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx0e33d80d35e4a3b1&redirect_uri=${escape(loginPage)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`;
Vue.prototype.req = function(param, backpage, backtype) {
uni.getNetworkType({
success: function(res) {
if (res.networkType == 'none') {
uni.showToast({
title: '网络连接异常,请检查网络',
icon: 'none'
})
return
}
}
})
var _self = this,
url = param.url,
method = 'POST',
header = {},
data = param.data || {},
Loading = param.Loading || false
Vue.prototype.req = function (param, backpage, backtype) {
uni.getNetworkType({
success: function (res) {
if (res.networkType == 'none') {
uni.showToast({
title: '网络连接异常,请检查网络',
icon: 'none'
})
return
}
}
})
var _self = this,
url = param.url,
method = 'POST',
header = {},
data = param.data || {},
Loading = param.Loading || false
var token = uni.getStorageSync('token')
// 我
// var token = 'bf3dd927642ea5a7a9ad90f1e1d1faab4d61cd33';
// 客户
// var token = '801abe6ec37a36b3ff37ded44be13c7bf06b629e';
var client = "";
// #ifdef H5
client = "h5";
// #endif
//拼接完整请求地址
var requestUrl = this.siteBaseUrl + url
if (method) {
method = method.toUpperCase() //小写改为大写
// console.log(token,11)
if (method == 'POST') {
header = {
'content-type': 'application/x-www-form-urlencoded',
client: client,
token: token,
adid: uni.getStorageSync('_ad_id'),
clickid: uni.getStorageSync('_click_id'),
var token = uni.getStorageSync('token')
// 我
// var token = 'bf3dd927642ea5a7a9ad90f1e1d1faab4d61cd33';
// 客户
// var token = '801abe6ec37a36b3ff37ded44be13c7bf06b629e';
}
//拼接完整请求地址
var requestUrl = this.siteBaseUrl + url
if (method) {
method = method.toUpperCase() //小写改为大写
// console.log(token,11)
if (method == 'POST') {
header = {
'content-type': 'application/x-www-form-urlencoded',
token: token,
adid: uni.getStorageSync('_ad_id'),
clickid: uni.getStorageSync('_click_id')
}
// if (uni.getStorageSync('_ad_id')) {
// header.adid = uni.getStorageSync('_ad_id')
// }
// if (uni.getStorageSync('_click_id')) {
// header.clickid = uni.getStorageSync('_click_id')
// }
} else {
header = {
'content-type': 'application/json'
}
}
} else {
method = 'GET'
header = {
'content-type': 'application/json'
}
}
//用户交互:加载圈
// console.log(!Loading)
if (!Loading) {
uni.showLoading({
title: '加载中...'
})
}
//网络请求
// if (uni.getStorageSync('_ad_id')) {
// header.adid = uni.getStorageSync('_ad_id')
// }
// if (uni.getStorageSync('_click_id')) {
// header.clickid = uni.getStorageSync('_click_id')
// }
} else {
header = {
'content-type': 'application/json'
}
}
} else {
method = 'GET'
header = {
'content-type': 'application/json'
}
}
//用户交互:加载圈
// console.log(!Loading)
if (!Loading) {
uni.showLoading({
title: '加载中...'
})
}
//网络请求
uni.request({
url: requestUrl,
method: method,
header: header,
data: data,
success: res => {
// if (requestUrl.indexOf('coupon_ling') != -1) {
// uni.showModal({
// title: '提示',
// content: JSON.stringify(res),
// showCancel: true,
// success: ({ confirm, cancel }) => {}
// })
// }
uni.request({
url: requestUrl,
method: method,
header: header,
data: data,
success: res => {
// if (requestUrl.indexOf('coupon_ling') != -1) {
// uni.showModal({
// title: '提示',
// content: JSON.stringify(res),
// showCancel: true,
// success: ({ confirm, cancel }) => {}
// })
// }
console.log("res.data.status", res.data.status)
if (res.data.status == 1) {
//返回结果码code判断:1成功,-1错误
// uni.showToast({
// title: res.data.msg,
// icon: 'none',
// })
} else if (res.data.status == 2222) {} else if (res.data.status == -9) {
let pages = getCurrentPages()
console.log(pages[pages.length - 1].route)
// uni.setStorageSync('page', pages[pages.length - 1].route)
setTimeout(() => {
uni.showToast({
title: res.data.msg,
icon: 'none',
success() {
setTimeout(() => {
// #ifdef H5
uni.navigateTo({
url: '/pages/user/bangdingweb'
})
// #endif
// #ifdef MP-WEIXIN
uni.navigateTo({
url: '/pages/user/bangding'
})
// #endif
console.log("res.data.status",res.data.status)
if (res.data.status == 1) {
//返回结果码code判断:1成功,-1错误
// uni.showToast({
// title: res.data.msg,
// icon: 'none',
// })
} else if (res.data.status == 2222) {
} else if (res.data.status == -9) {
let pages = getCurrentPages()
console.log(pages[pages.length - 1].route)
// uni.setStorageSync('page', pages[pages.length - 1].route)
setTimeout(() => {
uni.showToast({
title: res.data.msg,
icon: 'none',
success() {
setTimeout(() => {
uni.navigateTo({
url: '/pages/user/bangding'
})
}, 1500)
}
})
}, 100)
} else if (res.data.status == 0) {
setTimeout(function () {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}, 100)
} else if (res.data.status < 0) {
var pages = getCurrentPages()
for (var a = 0; a < pages.length; a++) {
console.log(pages[a].route)
if (pages[a].route == 'pages/user/index') {
uni.setStorageSync('lgurl', pages[a].route)
uni.setStorageSync('lgurldata', JSON.stringify(pages[a].options))
}
}
setTimeout(() => {
uni.showToast({
title: '请先登录',
icon: 'none'
})
}, 100)
uni.redirectTo({
url: '/pages/user/login'
})
} else {
return
}
typeof param.success == 'function' && param.success(res.data)
},
fail: e => {
console.log('网络请求fail:' + JSON.stringify(e))
typeof param.fail == 'function' && param.fail(e.data)
},
complete: () => {
uni.hideLoading()
typeof param.complete == 'function' && param.complete()
return
}
})
}, 1500)
}
})
}, 100)
} else if (res.data.status == 0) {
setTimeout(function() {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}, 100)
} else if (res.data.status < 0) {
var pages = getCurrentPages()
for (var a = 0; a < pages.length; a++) {
console.log(pages[a].route)
if (pages[a].route == 'pages/user/index') {
uni.setStorageSync('lgurl', pages[a].route)
uni.setStorageSync('lgurldata', JSON.stringify(pages[a].options))
}
}
setTimeout(() => {
uni.showToast({
title: '请先登录',
icon: 'none'
})
}, 100)
uni.redirectTo({
url: '/pages/user/login'
})
} else {
return
}
typeof param.success == 'function' && param.success(res.data)
},
fail: e => {
console.log('网络请求fail:' + JSON.stringify(e))
typeof param.fail == 'function' && param.fail(e.data)
},
complete: () => {
uni.hideLoading()
typeof param.complete == 'function' && param.complete()
return
}
})
}
function loadScript(url) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;
document.head.appendChild(script);
}
loadScript('https://res.wx.qq.com/open/js/jweixin-1.6.0.js');
Vue.prototype.onBridgeReady = function(data) {
var x = {
"appId": "wx2421b1c4370ec43b", //公众号ID由商户传入
"timeStamp": "1395712654", //时间戳自1970年以来的秒数
"nonceStr": "e61463f8efa94090b1f366cccfbbb444", //随机串
"package": "prepay_id=u802345jgfjsdfgsdg888",
"signType": "MD5", //微信签名方式:
"paySign": "70EA570631E4BB79628FBCA90534C63FF7FADD89" //微信签名
};
WeixinJSBridge.invoke(
'getBrandWCPayRequest', data,
function(res) {
console.log(res);
if (res.err_msg == "get_brand_wcpay_request:ok") {
// 使用以上方式判断前端返回,微信团队郑重提示:
//res.err_msg将在用户支付成功后返回ok但并不保证它绝对可靠。
}
});
}
// 测试
// const baseUrl = ''
const baseUrl = 'http://101.43.1.207'
@ -168,9 +213,10 @@ const baseUrl = 'http://101.43.1.207'
Vue.prototype.siteBaseUrl = baseUrl + '/api/'
Vue.prototype.$z_img2 = baseUrl + '/zcq/'
Vue.prototype.$baseUrl = baseUrl
Vue.prototype.$img = url => baseUrl + '/static/web' + url
// Vue.prototype.$img1 = url => baseUrl + '/static/web' + url
Vue.prototype.$img1 = url => baseUrl+'/static/web/static/'+ url
Vue.prototype.$img1 = url => baseUrl + '/static/web/static/' + url
Vue.prototype.$sys = () => uni.getSystemInfoSync()
@ -179,6 +225,7 @@ Vue.mixin(Mixin)
App.mpType = 'app'
const app = new Vue({
...App
...App
})
app.$mount()

View File

@ -1,6 +1,6 @@
{
"name" : "枫岚云赏",
"appid" : "__UNI__B7E0990",
"appid" : "__UNI__46B4383",
"description" : "",
"versionName" : "1.0.1",
"versionCode" : 101,
@ -168,14 +168,16 @@
},
"h5" : {
"router" : {
"mode" : "history"
"mode" : "hash",
"base" : "/h5/"
},
"uniStatistics" : {
"enable" : false
},
"devServer" : {
"https" : false
}
},
"template" : ""
},
"vueVersion" : "2",
"mp-kuaishou" : {

View File

@ -73,7 +73,7 @@
<view class="prize center" @click="preview(item)" style="background: linear-gradient( 141deg, rgba(255,242,222,0.24) 0%, rgba(249,219,172,0.19) 100%);">
<image :src="$img1('my/liwu.png')" mode="aspectFit"></image>
</view>
<view v-if="item.is_ling == 1" class="get-btn center" @click="doReceive(item)">
<view v-if="item.is_ling == 1 && item.pu_jiang.length>0" class="get-btn center" @click="doReceive(item)">
领取
</view>
</view>

View File

@ -402,6 +402,13 @@
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path" : "pages/user/bangdingweb",
"style" :
{
"navigationBarTitleText" : "绑定手机号"
}
}
],
"subPackages": [{
@ -487,7 +494,8 @@
"selectedColor": "#FFFFFF",
"borderStyle": "black",
"backgroundColor": "#111111",
"iconWidth": "60px",
"iconWidth": "140rpx",
// "iconHeight": "100rpx",
"list": [{
"pagePath": "pages/shouye/index",
"iconPath": "static/tabbar/m1.png",

View File

@ -300,16 +300,19 @@
if (type == 1) {
that.close('pop')
if (res.data.status == 1) {
const status = await that.$c.wxMpPay({
data: res.data.res
})
if (status == 'success') {
// that.getPrize(res.data.order_num)
that.getData();
}
} else {
that.$c.toast({
title: res.msg,

View File

@ -114,7 +114,8 @@
<view v-if="tabList[tabCur].id == 1" class="bt-fixed">
<template v-if="subTab[subTabCur].id != 4">
<view v-if="subTab[subTabCur].id != 6 && listData.length && is_exchange=='1'" class="btn center" @click="open('changePop')">兑换</view>
<view v-if="subTab[subTabCur].id != 6 && listData.length && is_exchange=='1'" class="btn center"
@click="open('changePop')">兑换</view>
<view v-if="subTab[subTabCur].id != 2" class="btn2 center" @click="open('sendPop')">发货</view>
<view v-if="subTab[subTabCur].id != 6" class="btn center" @click="open('model')">上锁</view>
</template>
@ -251,16 +252,16 @@
<view class="agree" @click="isAgree = !isAgree">
<view class="icon">
<image v-if="isAgree" :src="$img1('common/check_act.png')" lazy-load></image>
<image v-else :src="$img1('common/check.png')" lazy-load></image>
</view>
我已满18岁,阅读并同意
<text @click.stop="$c.to({ url: '/pages/guize/guize?type=4' })">
用户协议
</text>
<text @click.stop="$c.to({ url: '/pages/guize/guize?type=5' })">
隐私政策
</text>
@ -404,8 +405,8 @@
}
},
onLoad() {
this.$nextTick(()=>{
this.$refs.mescrollRef.mescroll.optUp.empty.tip='~ 快来抽赏吧 ~'
this.$nextTick(() => {
this.$refs.mescrollRef.mescroll.optUp.empty.tip = '~ 快来抽赏吧 ~'
})
},
computed: {
@ -518,7 +519,70 @@
chooseAdd() {
this.canReload = false
var that=this;
// #ifdef H5
this.req({
url: 'getAccessTokenOffiaccountSign',
data: {
// recovery_info: JSON.stringify(data)
url: location.href.split('#')[0]
},
success: res => {
console.log(res);
if (res.status == 1) {
var _data = res.data;
wx.config({
debug: false, // ,apialertpclogpc
appId: _data.appId,
timestamp: _data.timestamp,
nonceStr: _data.noncestr,
signature: _data.signature,
jsApiList: [
'checkJsApi',
'openAddress',
]
});
wx.ready(function() {
wx.checkJsApi({
jsApiList: [
'openAddress',
],
success: function(res) {
// alert(res);
// console.log(res);
wx.openAddress({
success: function(res) {
console.log(res);
that.addData = res;
// var userName = res.userName; //
// var postalCode = res.postalCode; //
// var provinceName = res
// .provinceName; //
// var cityName = res.cityName; //
// var countryName = res
// .countryName; //
// var detailInfo = res.detailInfo; //
// var nationalCode = res.nationalCode; //
// var telNumber = res.telNumber; //
}
});
}
});
});
wx.error(function(res) {
// configerrorconfigdebugresSPA
console.log("出现错误", res);
});
}
}
})
// #endif
// #ifdef MP-WEIXIN
uni.chooseAddress({
success: res => {
console.log(res)
@ -534,6 +598,8 @@
}, 500)
}
})
// #endif
},
submitLock() {
@ -573,7 +639,7 @@
},
submitSend() {
if(!this.isAgree) {
if (!this.isAgree) {
this.$c.toast({
title: '请阅读并同意《用户协议》《隐私政策》'
})
@ -1022,7 +1088,8 @@
font-weight: 400;
color: #ffffff;
}
.yu-tag{
.yu-tag {
position: absolute;
right: 10rpx;
bottom: 30rpx;
@ -1214,7 +1281,8 @@
bottom: var(--window-bottom);
// #endif
// #ifdef MP
bottom: calc(var(--window-bottom) + 160rpx);;
bottom: calc(var(--window-bottom) + 160rpx);
;
// #endif
width: 750rpx;
box-sizing: border-box;
@ -1644,6 +1712,7 @@
}
}
}
.agree {
display: flex;
margin-top: 30rpx;
@ -1651,7 +1720,7 @@
font-weight: 400;
color: #ffffff;
line-height: 32rpx;
.icon {
width: 32rpx;
height: 32rpx;
@ -1672,7 +1741,8 @@
justify-content: center;
font-weight: 500;
color: #7825DE;
>text:nth-child(1){
>text:nth-child(1) {
font-size: 28rpx;
margin-top: 32rpx;
}
@ -1742,7 +1812,7 @@
height: 100vh;
position: relative;
background: url($imgurl+'common/yb.png') no-repeat 0 0 / 100% 100%;
.res-pop-hd {
width: 380rpx;
height: 104rpx;
@ -1785,7 +1855,8 @@
margin: 112rpx auto 0;
box-sizing: border-box;
background: url($imgurl+'common/jixuchou.png') no-repeat 0 0 / 100% 100%;
>text{
>text {
color: #7825DE;
margin-top: 28rpx;
}

View File

@ -10,8 +10,10 @@
<image class="img100" :src="$img1('common/indexTitle.png')"></image>
</view>
</view>
<mescroll-body ref="mescrollRef" class="valbox" @init="mescrollInit" :down="downOption" @down="downCallback" @up="loadData">
<swiper class="swiper-box" :autoplay="true" :indicator-dots="false" :circular="true" :interval="3000" @change="swChange">
<mescroll-body ref="mescrollRef" class="valbox" @init="mescrollInit" :down="downOption" @down="downCallback"
@up="loadData">
<swiper class="swiper-box" :autoplay="true" :indicator-dots="false" :circular="true" :interval="3000"
@change="swChange">
<swiper-item v-for="(v, i) in advert" :key="i" @click="$c.navTo(v)">
<image class="yh_bg" :src="v.imgurl"></image>
</swiper-item>
@ -19,9 +21,11 @@
<view class="sw-dot relative">
<view class="sw-dot-item" v-for="(item, i) in advert" :key="i" :class="{act: swCur == i}"></view>
</view>
<view class="news-box relative" :style="{ backgroundImage: `url(${$img1('index/notification.png')})`}" @click="$refs.rulePop.getRule(3, '提示')">
<view class="news-box relative" :style="{ backgroundImage: `url(${$img1('index/notification.png')})`}"
@click="$refs.rulePop.getRule(3, '提示')">
<view class="news-text">
<uni-notice-bar :style="{width: `100%`}" :speed="8" background-color="transparent" color="#fff" scrollable single :text="$c.filterText(gonggao)"></uni-notice-bar>
<uni-notice-bar :style="{width: `100%`}" :speed="8" background-color="transparent" color="#fff"
scrollable single :text="$c.filterText(gonggao)"></uni-notice-bar>
</view>
</view>
<view class="flex yqhy" @tap="$c.to({url:'/pages/user/tui-guang'})">
@ -162,11 +166,15 @@
id: 9,
title: '枫岚赏'
},
{
id: 8,
title: '领主赏'
},
{
id: 12,
title: '冲冲赏'
},
// {
// id: 3,
// title: ''
@ -1101,8 +1109,8 @@
}
.group-fixed {
width: 164rpx;
height: 164rpx;
width: 141rpx;
height: 50rpx;
position: fixed;
z-index: 10;
right: 0;

178
pages/user/bangdingweb.vue Normal file
View File

@ -0,0 +1,178 @@
<template>
<view class="box">
<!-- <uni-popup ref="popup" type="bottom"> -->
<view class="header">
<image :src="$img1('common/logo.png')"></image>
</view>
<view class="content">
<view>申请获取以下权限</view>
<text>获得您的手机号</text>
<view style="margin-top:1.5rem; " class="input-box br10">
<input class="uni-input" v-model="mobile" placeholder-style="color:#CCCCCC;" focus
placeholder="请输入手机号" />
</view>
</view>
<!-- type='primary' -->
<button class="bottom" @click="getPhoneNumber()">
绑定手机号
</button>
<view class="quxiao" @click="back()">取消</view>
<!-- </uni-popup> -->
</view>
</template>
<script>
export default {
data() {
return {
z_imgPath: this.$z_img2,
mobile: ""
}
},
created() {
//
// this.login();
},
methods: {
back() {
uni.navigateBack()
},
validatePhoneNumber(phoneNumber) {
//
const phoneRegex = /^1[3-9]\d{9}$/;
return phoneRegex.test(phoneNumber);
},
getPhoneNumber(e) {
// console.log(e)
if (this.mobile == "") {
uni.showToast({
title: '请输入手机号~',
icon: 'success',
success() {}
})
return;
}
if (!this.validatePhoneNumber(this.mobile)) {
uni.showToast({
title: '手机号格式不正确~',
icon: 'success',
success() {}
})
return;
}
let that = this
that.req({
url: 'login_bind_mobile_h5',
data: {
mobile: that.mobile,
},
success(res) {
if (res.status == 1) {
// uni.setStorageSync('token', res.data)
uni.showToast({
title: '绑定成功~',
icon: 'success',
success() {
setTimeout(() => {
uni.navigateBack()
}, 1000)
}
})
}
}
})
}
}
}
</script>
<style lang="scss">
/* .box {
position: fixed;
bottom: 0;
} */
.header {
margin: 90rpx 0 90rpx 50rpx;
border-bottom: 1px solid #ccc;
text-align: center;
width: 650rpx;
height: 300rpx;
line-height: 450rpx;
}
.header image {
width: 200rpx;
height: 200rpx;
}
.content {
margin-left: 50rpx;
margin-bottom: 90rpx;
color: #fff;
}
.content text {
display: block;
margin-top: 40rpx;
}
.input-box {
width: 615rpx;
height: 70rpx;
background: #0B0A1A;
border: 1px solid #B07AF3;
box-sizing: border-box;
padding: 0 30rpx;
display: flex;
align-items: center;
input {
flex: 1;
font-size: 26rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #fff;
}
}
.bottom {
/* border-radius: 80rpx; */
margin: 70rpx 50rpx;
font-size: 35rpx;
}
button::after {
border: none;
}
button {
background: #AD77EF;
font-size: 36rpx;
font-family: zihun152hao-jijiachaojihei;
font-weight: 400;
color: #ffffff;
border-radius: 80rpx;
}
.quxiao {
background: linear-gradient(90deg, #2dcbff 0%, #ff95fb 100%);
filter: grayscale(1);
width: 650rpx;
height: 78rpx;
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
border-radius: 80rpx;
margin: auto;
font-size: 36rpx;
font-family: zihun152hao-jijiachaojihei;
font-weight: 400;
color: #ffffff;
}
</style>

View File

@ -72,9 +72,16 @@
isAgree: false
}
},
onLoad() {
onLoad(option) {
//
// this.login();
console.log(window.location.href, option);
if (option != null) {
if (option.code != null) {
//
this.h5Login(option.code);
}
}
},
methods: {
//===
@ -84,7 +91,16 @@
title: '请阅读并同意《用户协议》和《隐私政策》'
})
}
// #ifdef H5
this.h5UserProfile();
// #endif
// #ifdef MP-WEIXIN
this.wxUserProfile();
// #endif
},
wxUserProfile() {
var that = this
uni.getUserProfile({
desc: '用于向用户发送商品', //
@ -136,7 +152,7 @@
})
},
complete: (e) => {
console.log(e,'登录');
console.log(e, '登录');
}
})
},
@ -144,6 +160,60 @@
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')
//http://api.zpc-xy.com/login.html
//http://192.168.195.30:8080/#/pages/user/login?code=021gjuFa1F8OOH0uLeJa1T5fMh4gjuFA&state=STATE
//http://192.168.195.30:8080/pages/user/login pages/user/wxlogin
// var redirect_uri = escape(this.$loginPage);
window.location.href =this.$wxloginPage;
// `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx0e33d80d35e4a3b1&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`;
}
}
}

View File

@ -35,7 +35,8 @@
</view>
</view>
</view>
<button open-type="share" class="invite-btn"></button>
<button v-if="!ish5" open-type="share" class="invite-btn"></button>
<button v-if="ish5" class="invite-btn" @click="fenxiang()"></button>
</view>
<view class="invite-log">
@ -72,6 +73,10 @@
<script>
export default {
data() {
var isH5 = false;
// #// #ifdef H5
isH5 = true;
// #endif
return {
downOption: {
use: false
@ -79,6 +84,7 @@
listdata: [],
news: '',
total: 0,
ish5: isH5,
logo_image: '',
commission: 0
}
@ -104,6 +110,67 @@
//
this.loadData(page.num)
},
fenxiang() {
var that = this;
var image=this.$baseUrl+"/storage/topic/20240617/30a73c0d5061f700a66f653deeb60f6d.jpg";
console.log(image);
// #ifdef H5
this.req({
url: 'getAccessTokenOffiaccountSign',
data: {
// recovery_info: JSON.stringify(data)
url: location.href.split('#')[0]
},
success: res => {
console.log(res);
if (res.status == 1) {
var _data = res.data;
wx.config({
debug: false, // ,apialertpclogpc
appId: _data.appId,
timestamp: _data.timestamp,
nonceStr: _data.noncestr,
signature: _data.signature,
jsApiList: [
'checkJsApi',
'updateAppMessageShareData',
]
});
wx.ready(function() {
wx.checkJsApi({
jsApiList: [
'openAddress',
],
success: function(res) {
// alert(res);
// console.log(res);
var urlx = location.href.split('#')[0] +
'#/pages/shouye/index?pid=' + uni
.getStorageSync('userinfo').ID;
wx.updateAppMessageShareData({
title: '枫岚一番,正版潮玩手办一番赏', //
desc: '', //
link: urlx, // JS
imgUrl: image, //
success: function() {
//
}
})
}
});
});
wx.error(function(res) {
// configerrorconfigdebugresSPA
console.log("出现错误", res);
});
}
}
})
},
loadData(pageNo) {
//
let that = this