Commit c304e772 authored by mengcuiguang's avatar mengcuiguang

调试投放、登录、支付

parent f3e7a126
......@@ -147,7 +147,8 @@
windowWidth: 0,
bottomSafePadding: 12,
h5Url: 'https://api.mints-id.com/index.html',
baseUrl: 'https://api.mints-tech.cn/camera-api/miniApi',
// baseUrl: 'https://api.mints-tech.cn/camera-api/miniApi',
baseUrl: 'http://192.168.110.71:8301/miniApi',
// baseUrl: 'http://test.mints-id.com/ww-new/api',
titleButtonWidth: 38,
token: '',
......@@ -161,7 +162,7 @@
auth: false, // 三要素实名认证
userInfo: null,
cardInfo: null,
pkgName: 'com.mints.helivideo'
pkgName: 'com.mints.minivideo'
}
};
</script>
......
......@@ -89,7 +89,6 @@ export default {
},
logout() {
app.globalData.userInfo = null;
app.globalData.token = '';
app.globalData.userId = 0;
app.globalData.auth = false;
uni.removeStorageSync('token');
......@@ -125,18 +124,7 @@ 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('&')
// }
const success = options?.success;
const fail = options?.fail;
const header = options?.header ?? {};
......@@ -146,8 +134,8 @@ export default {
let requestTask;
Object.assign(header, {
// token: app.globalData.token,
token: 'AC8FA7EB65C3074472378362124462E70E762CAB0EAD1C6EABB742EB893A61C05F433703067DF5142735505C42F58997',
token: uni.getStorageSync('token'),
// token: 'AC8FA7EB65C3074472378362124462E70E762CAB0EAD1C6EABB742EB893A61C05F433703067DF5142735505C42F58997',
pkgName: app.globalData.pkgName
})
......
......@@ -14,8 +14,8 @@ export default {
data() {
return {
share: {
title: '3D打印你的专属伴侣,点击立刻拥有她/他!',
imageUrl: 'http://mints-sh.oss-cn-shanghai.aliyuncs.com/userImg/share.jpg',
title: '更多好剧,等你来看',
imageUrl: 'https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/ic_movie.png',
path: '/pages/loading?shareId=' + getApp().globalData.userId,
}
}
......
......@@ -218,18 +218,18 @@
this.topList = data.list;
}
});
// 最近观看剧
this.post({
url: '/vedio/newest',
data: {},
showLoading: false,
success: ({
data
}) => {
if (data.vedio != null) {
this.newRecordBean = data.vedio;
}
}
// 最近观看剧
this.post({
url: '/vedio/newest',
data: {},
showLoading: false,
success: ({
data
}) => {
if (data.vedio != null) {
this.newRecordBean = data.vedio;
}
}
});
},
hide() {
......
......@@ -36,83 +36,96 @@
export default {
name: 'loading',
mixins: [common],
data() {
return {
shareId: ''
}
},
onLoad(options) {
// message.notify('分享id='+options.shareId);
this.shareId = options.shareId;
},
onLaunch(options) {},
onShow(options) {
this.wxlogin();
setTimeout(() => {
redirectTo('home');
}, 2300);
data() {
return {
tips1: ''
}
},
onLoad(options) {
this.tips1 = options.tips1;
},
onShow(options) {
this.wxlogin();
// setTimeout(() => {
// redirectTo('home');
// }, 2800);
},
methods: {
methods: {
wxlogin() {
var that=this;
var obj = wx.getEnterOptionsSync()
var channel = '' // 渠道
var clueToken = '' // 归因参数
var adId = '' // 计划id
var advertiserId = '' // 账号id
var reqId = '' // 请求id
var promotionId = '' // aid
var productId = ''
if (obj.query.clueToken ?? '' != '') {
channel = 'tt'
clueToken = obj.query.clueToken ?? ''
adId = obj.query.adId ?? ''
advertiserId = obj.query.advertiserId ?? ''
reqId = obj.query.reqId ?? ''
promotionId = obj.query.promotionId ?? ''
productId = obj.query.productId ?? ''
}
if (obj.query.ksChannel ?? '' != '') {
channel = 'kuaishou'
advertiserId = obj.query.accountid ?? ''
clueToken = obj.query.callback ?? ''
adId = obj.query.aid ?? ''
}
uni.login({
provider: 'weixin',
success: function(loginRes) {
that.post({
url: '/user/wechatlogin',
data: {
channel: channel,
clueToken: clueToken,
code: loginRes.code,
adId: adId,
advertiserId: advertiserId,
reqId: reqId,
promotionId: promotionId,
productId: productId,
},
showLoading: false,
success: ({
data
}) => {
app.globalData.token = data.token;
app.globalData.userId = data.pk_id;
app.globalData.userInfo = data;
redirectTo('home');
}
});
},
fail: function(err) {
// 登录授权失败
message.notify('登录授权失败 错误码:' + err.code);
}
});
var that=this;
// var obj = wx.getEnterOptionsSync()
var obj = wx.getLaunchOptionsSync()
var channel = 'mints' // 渠道
var clueToken = '' // 归因参数
var adId = '' // 计划id
var advertiserId = '' // 账号id
var reqId = '' // 请求id
var promotionId = '' // aid
var projectId = '';
var tips2 = '';
if (obj.query.clue_token ?? '' != '') {
channel = 'tt'
clueToken = obj.query.clue_token ?? ''
adId = obj.query.ad_id ?? ''
advertiserId = obj.query.advertiser_id ?? ''
reqId = obj.query.req_id ?? ''
promotionId = obj.query.promotion_id ?? ''
projectId = obj.query.project_id ?? ''
tips2 = obj.query.tips2 ?? ''
}
if (obj.query.ksChannel ?? '' != '') {
channel = 'kuaishou'
advertiserId = obj.query.accountid ?? ''
clueToken = obj.query.callback ?? ''
adId = obj.query.aid ?? ''
}
if(this.tips1=='mints_vedio'||tips2=='mints_vedio'){
toastMessage("JSON.stringify(this.log)="+JSON.stringify(obj.query)+"channel=" + channel + "clueToken=" + clueToken +
"adId=" + adId + "advertiserId=" + advertiserId + "projectId=" + projectId +
"reqId=" + reqId + "promotionId=" + promotionId);
}
uni.login({
provider: 'weixin',
success: function(loginRes) {
that.post({
url: '/user/wechatlogin',
data: {
channel: channel,
clueToken: clueToken,
code: loginRes.code,
adId: adId,
advertiserId: advertiserId,
reqId: reqId,
promotionId: promotionId,
projectId: projectId,
},
showLoading: false,
success: ({
data
}) => {
uni.setStorage({
key: 'token',
data: data.token
});
app.globalData.userId = data.pk_id;
app.globalData.userInfo = data;
setTimeout(() => {
redirectTo('home');
}, 1500);
}
});
},
fail: function(err) {
// 登录授权失败
message.notify('登录授权失败 错误码:' + err.code);
}
});
}
}
};
......
......@@ -5,7 +5,6 @@
<image class="avatar" src="@/static/logo-about.png"></image>
<view>
<view style="font-size: 26rpx;color: black;margin-left: 20rpx;">用户ID:{{userBean.idcode}}</view>
<!-- <view style="font-size: 32rpx;color: black;font-weight: 777;margin-left: 20rpx;">未登录</view> -->
</view>
</view>
......@@ -111,7 +110,6 @@
navigateTo(`/pagesA/vipPay/vipPay`)
},
handlePhone() {
let that = this
// 联系我们
this.post({
url: '/app/customerServiceNumbers',
......
......@@ -34,7 +34,7 @@
<image style="width: 100%;" src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/bg_vip_0.png" mode="widthFix" />
<image style="width: 100%;" src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/bg_vip_1.png" mode="widthFix" />
<image style="width: 100%;margin-bottom: 80rpx;" src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/bg_vip_1.png" mode="widthFix" />
</scroll-view>
</view>
</template>
......@@ -75,26 +75,58 @@
choosePack(item, index) {
this.selectedIndex = index;
},
handlePay() {
handlePay() {
let that=this;
let vipBean = this.vipList[this.selectedIndex];
message.notify('vipBean 价格=' + vipBean.firstPayPrice);
// this.post({
// url: '/vip/getVipPayParams',
// data: {
// pid: vipBean.pid,
// payChannel: 'WEIXIN'
// },
// showLoading: false,
// success: ({
// data
// }) => {
// let wxParams = data.params
// // 发起微信支付
// }
// });
this.post({
url: '/vip/getVipPayParams',
data: {
pid: vipBean.pid,
payChannel: 'WEIXIN'
},
showLoading: false,
success: ({
data
}) => {
that.wxPay(data);
}
});
},
wxPay(wxData){
let wxParams = wxData.params;
let that=this;
// 发起微信支付
wx.requestPayment({
timeStamp: wxParams.timeStamp,
nonceStr: wxParams.nonceStr,
package: wxParams.packageStr,
signType: wxParams.signType,
paySign: wxParams.paySign,
success(res) {
message.notify('支付成功')
that.post({
url: '/vip/queryVipOrder',
data: {
tid: wxData.tid
},
showLoading: false,
success: ({
data
}) => {
}
});
setTimeout(() => {
redirectTo('home');
}, 1000);
},
fail(res) {
message.notify('取消支付')
}
})
}
}
}
......
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