Commit 4b0035ca authored by mengcuiguang's avatar mengcuiguang

接口调试

parent 734d6e7d
......@@ -147,7 +147,7 @@
windowWidth: 0,
bottomSafePadding: 12,
h5Url: 'https://api.mints-id.com/index.html',
baseUrl: 'https://api.mints-id.com/ww-new/api',
baseUrl: 'https://api.mints-tech.cn/camera-api/miniApi',
// baseUrl: 'http://test.mints-id.com/ww-new/api',
titleButtonWidth: 38,
token: '',
......@@ -160,7 +160,8 @@
realNameStatus: false,
auth: false, // 三要素实名认证
userInfo: null,
cardInfo: null
cardInfo: null,
pkgName: "com.mints.helivideo"
}
};
</script>
......
......@@ -23,21 +23,24 @@ export default {
},
onLoad(options) {
this.options = options;
this.loadData();
},
onShow() {
if (app.globalData.token) {
if (!app.globalData.userInfo) {
// this.getUserInfo();
} else {
this.infoAuth();
}
} else {
if (this.auth) {
this.login();
} else {
this.loadData();
}
}
// this.loadData();
// if (app.globalData.token) {
// if (!app.globalData.userInfo) {
// // this.getUserInfo();
// } else {
// this.infoAuth();
// }
// } else {
// if (this.auth) {
// this.login();
// } else {
// this.loadData();
// }
// }
},
onHide() {
if (this.xhrPool.size) {
......@@ -186,50 +189,44 @@ export default {
data,
auth
} = options;
let params = [];
if (data) {
for (let key in data) {
params.push(`${key}=${data[key]}`)
}
}
if (auth) {
params.push(`session=${app.globalData.token}`)
}
if (params.length) {
url += '?' + params.join('&')
}
// let params = [];
// if (data) {
// for (let key in data) {
// params.push(`${key}=${data[key]}`)
// }
// }
// if (auth) {
// params.push(`session=${app.globalData.token}`)
// }
// if (params.length) {
// url += '?' + params.join('&')
// }
const success = options?.success;
const fail = options?.fail;
// const header = options?.header ?? {};
const header = options?.header ?? {};
showLoading && loading.show();
let requestTask;
// Object.assign(header, {
// token: app.globalData.token
// })
Object.assign(header, {
// token: app.globalData.token,
token: 'AC8FA7EB65C3074472378362124462E70E762CAB0EAD1C6EABB742EB893A61C05F433703067DF5142735505C42F58997',
pkgName: app.globalData.pkgName
})
options = Object.assign(options, {
url: `${app.globalData.baseUrl}${url}`,
// header,
header,
data,
success: (res) => {
showLoading && loading.hide();
switch (res.data.code) {
case '200':
case '303':
case '304':
switch (res.data.status) {
case 200:
if (success) {
success(res.data);
}
break;
case '40000':
if (fail) {
fail(res.data.msg);
}
// this.logout();
// this.login();
break;
default:
if (fail) {
fail(res.data.msg);
......
<template>
<view class="body">
首页
<!-- <z-paging class="flex-1" ref="paging" v-model="dataList" @query="queryList"> -->
<view class="content">
<swiper class="banner" :indicator-dots="true" :autoplay="true" :interval="2000" :duration="500">
<swiper-item v-for="banner in bannerList" :key="banner.vedioId" @click="handleBanner(banner.vedioId)">
<image class="banner-img" :src="banner.coverImage" mode="aspectFill"></image>
</swiper-item>
</swiper>
</view>
<!-- </z-paging> -->
</view>
</template>
<script>
import common from '@/mixins/common';
import {
base64Compress,
imageCompress,
getToLocal
} from "@/utils/utils.js"
......@@ -29,56 +37,49 @@
mixins: [common],
data() {
return {
showlip: false
showlip: false,
dataList: [],
bannerList: []
};
},
methods: {
show() {
// if (this.$refs.paging != null) {
// this.$refs.paging.refresh();
// }
// }
console.log('showshowshow');
},
loadData() {
loadData() {
this.post({
url: '/app/getVideoConfig',
data: {
session: app.globalData.token
},
url: '/vedio/topTabs',
showLoading: false,
success: ({
data
}) => {
// this.$refs.paging.complete(data.color);
// this.videoConfig = data
// this.dataList = data.color
// this.currentIndex = 0
// this.videoUrl = data.topVideo
// this.runingVideo = data.runingVideo
// this.currentImageUrl =
// 'https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg_companionx/ic_main_none_icon.png'
// this.jobId = ''
// this.isUpImg = false
// if (this.videoContext == '') {
// this.videoContext = uni.createVideoContext('homeVideo', this)
// }
// this.playVideo()
}) => {
console.log(data);
// console.log("data.data.list="+data.data.list);
this.bannerList = data.list;
}
});
},
downloadApp() {
if (app.globalData.userInfo) {
openUrl(app.globalData.downUrl);
} else {
// navigateTo('user/login', {
// redirect: "index"
// });
}
},
// queryList(page, size) {
// // this.post({
// // url: '/nft/list',
// // data: {
// // page,
// // size
// // },
// // showLoading: false,
// // success: ({
// // data
// // }) => {
// // this.$refs.paging.complete(data);
// // }
// // });
// },
handleBanner(vedioId) {
}
}
};
......@@ -88,4 +89,4 @@
.body {
background-color: white;
}
</style>
</style>
\ No newline at end of file
......@@ -59,7 +59,7 @@
onShow(options) {
this.wxlogin()
setTimeout(() => {
redirectTo('home?coupon=' + this.coupon);
redirectTo('home');
}, 2300);
},
methods: {
......@@ -99,7 +99,8 @@
success: function(loginRes) {
that.post({
url: '/app/wxLogin',
url: '/app/wxLogin',
data: {
channel: channel,
clueToken: clueToken,
......@@ -115,33 +116,29 @@
data
}) => {
uni.setStorage({
key: 'token',
data: data.session
});
// 0 展示商品 1 展示换脸
uni.setStorage({
key: 'fromType',
data: '' + data.fromType
});
//买家秀开关,1开,其它关
uni.setStorage({
key: 'buyerShowEnable',
data: data.buyerShowEnable
});
//推广开关,1开,其它关
uni.setStorage({
key: 'promotionEnable',
data: data.promotionEnable
});
// uni.setStorage({
// key: 'token',
// data: data.session
// });
// // 0 展示商品 1 展示换脸
// uni.setStorage({
// key: 'fromType',
// data: '' + data.fromType
// });
// //买家秀开关,1开,其它关
// uni.setStorage({
// key: 'buyerShowEnable',
// data: data.buyerShowEnable
// });
// //推广开关,1开,其它关
// uni.setStorage({
// key: 'promotionEnable',
// data: data.promotionEnable
// });
app.globalData.token = data.session;
app.globalData.userId = data.userId;
app.globalData.userInfo = data;
if (data.coupon != null) {
that.coupon = data.coupon.price
}
}
});
......
<template>
<view class="body">
<status-title :showBack="false">推广</status-title>
<z-paging class="mt-30" ref="paging" style="height: 100%;" v-model="dataList" @query="queryList"
:loading-more-enabled="false">
<view class="item-wrap" v-for="(item, index) in dataList" :key="index" @click="itemClick(index)">
<image :src="item.imgUrl"></image>
<!-- <view class="btn">立即参与</view> -->
</view>
</z-paging>
推荐
</view>
</template>
<script>
import common from '@/mixins/common';
import {
base64Compress,
imageCompress,
getToLocal
} from "@/utils/utils.js"
import {
navigateTo,
message,
alert,
loading
} from '@/utils/fun.js';
import {
openUrl
} from '@/utils/app+.js';
const app = getApp();
export default {
name: 'index',
mixins: [common],
data() {
return {
dataList: [
// {
// imgUrl: 'https://mints-sh.oss-cn-shanghai.aliyuncs.com/system/ww/1671448004109.jpeg',
// type: "sign"
// },
{
imgUrl: 'https://mints-sh.oss-cn-shanghai.aliyuncs.com/system/ww/1671448035885.jpeg',
type: "spread"
},
{
imgUrl: 'https://mints-sh.oss-cn-shanghai.aliyuncs.com/system/ww/1671448048068.jpeg',
type: "agency"
},
{
imgUrl: 'https://mints-sh.oss-cn-shanghai.aliyuncs.com/system/ww/1671448057030.jpeg',
type: "cooperation"
}
]
}
showlip: false
};
},
methods: {
show() {
if (this.$refs.paging != null) {
this.$refs.paging.refresh();
}
this.loadData()
// if (this.$refs.paging != null) {
// this.$refs.paging.refresh();
// }
},
queryList() {
loadData() {
this.post({
url: '/app/getVideoConfig',
data: {
session: app.globalData.token
},
showLoading: false,
success: ({
data
}) => {
// this.$refs.paging.complete(data.color);
// this.videoConfig = data
// this.dataList = data.color
// this.currentIndex = 0
// this.videoUrl = data.topVideo
// this.runingVideo = data.runingVideo
// this.currentImageUrl =
// 'https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg_companionx/ic_main_none_icon.png'
// this.jobId = ''
// this.isUpImg = false
// if (this.videoContext == '') {
// this.videoContext = uni.createVideoContext('homeVideo', this)
// }
// this.playVideo()
}
});
},
itemClick(val) {
if (val == 0) {
// 个人推广
navigateTo(`/pagesC/spreadDetail/spreadDetail?id=` + val)
} else if (val == 1) {
// 成为代理
navigateTo(`/pagesC/spreadDetail/spreadDetail?id=` + val)
} else if (val == 2) {
// 体验馆合作
navigateTo(`/pagesC/spreadDetail/spreadDetail?id=` + val)
downloadApp() {
if (app.globalData.userInfo) {
openUrl(app.globalData.downUrl);
} else {
// navigateTo('user/login', {
// redirect: "index"
// });
}
}
}
}
};
</script>
<style lang="scss">
<style lang="scss" scoped>
.body {
// background-color: #fff;
}
.item-wrap {
border-radius: 30rpx;
height: 320rpx;
width: 90%;
margin-bottom: 30rpx;
margin-left: auto;
margin-right: auto;
position: relative;
image {
border-radius: 30rpx;
width: 100%;
height: 320rpx;
position: absolute;
top: 0;
}
.btn {
color: #163146;
border-radius: 300rpx;
border: solid 1rpx #163146;
text-align: center;
line-height: 70rpx;
background-color: aqua;
left: 50%;
margin-left: -150rpx;
bottom: 30rpx;
position: absolute;
width: 300rpx;
height: 70rpx;
}
background-color: white;
}
</style>
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