var a = getApp();
Page({
data: {
suiji: "",
contactTip: "",
selectedStar: "",
selectedAge: "",
index: 1,
ageList: ["0-18", "18-25", "25-30", "30-99"],
starList: ["白羊座", "金牛座", "双子座", "巨蟹座", "狮子座", "处女座", "天秤座", "天蝎座", "射手座", "魔羯座", "水瓶座", "双鱼座"],
sex: "",
container: "",
containertxt: "",
isShowModal: !1,
cardCur: 0,
swiperList: [],
gzhUrl: "",
indexTip: "",
indexTipStatus: !1,
sharePic: "",
shareTitle: "",
videoAd: "",
originAd: "",
chapinAd: "",
bannerAd: "",
showStatus: !0
},
tapceshi: function() {
wx.showModal({
title: '哇偶,运气爆表',
content: '您的爱情指数为67😊',
success (res) {
if (res.confirm) {
console.log('用户点击确定')
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
// 复制
confirmWord: function () {
var t = this;
wx.setClipboardData({
data: this.data.userInfo.code,
success: function (e) {
t.setData({
isShowModal: !1
});
}
});
},
hideModal: function () {
this.setData({
isShowModal: !1
});
},
showPop: function () {
this.hidestarModal()
var t = this;
wx.showLoading({
title: "获取中...."
}), wx.cloud.callFunction({
name: "user",
data: {
action: "getCode",
gender: this.data.sex,
selectedAge: this.data.selectedAge
},
success: function (e) {
console.log("[云函数]getcode", e), -1 == e.result.code ? wx.showToast({
icon: "none",
title: t.data.contactTip
}) : 0 == e.result.code ? wx.showToast({
icon: "none",
title: "请先登记,再来匹配"
}) : (
t.setData({
suiji : Math.ceil(Math.random()*e.result.data.length),
isShowModal: !0,
userInfo: e.result.data
}), wx.hideLoading({
success: function (t) {}
}),
console.log(t.data.suiji),
console.log(t.data.userInfo[t.data.suiji]),
t.setData({
userInfo: t.data.userInfo[t.data.suiji]
})
);
},
fail: function (t) {
wx.hideLoading({
success: function (t) {}
}), console.error("[云函数] [getcode] 调用失败", t);
}
});
},
pay(payData) {
let that = this;
//官方标准的支付方法
wx.requestPayment({
timeStamp: payData.timeStamp,
nonceStr: payData.nonceStr,
package: payData.package, //统一下单接口返回的 prepay_id 格式如:prepay_id=***
signType: 'MD5',
paySign: payData.paySign, //签名
success(res) {
console.log("支付成功", res)
, that.showPop();
},
fail(res) {
console.log("支付失败", res)
},
complete(res) {
console.log("支付完成", res)
}
})
},
createOrder: function() {
let that = this;
wx.cloud.callFunction({
name: "pay",
data: {
money: that.data.index
},
success(res) {
console.log("提交成功", res.result)
that.pay(res.result)
},
fail(res) {
console.log("提交失败", res)
}
})
},
confirmAgeChange: function () {
"" != this.data.selectedAge ? (this.setData({
isShowSelectModal: !1
}), this.createOrder()) : wx.showToast({
title: "请选择意向年龄"
});
},
selectAgeChange: function (t) {
console.log(t), this.setData({
selectedAge: t.detail.value
});
},
hideAgeModal: function () {
this.setData({
isShowSelectModal: !1
});
},
showSelectAgeModal: function (t) {
this.data.sex = t.currentTarget.dataset.gender, this.setData({
sex: t.currentTarget.dataset.gender,
isShowSelectModal: !0
});
console.log(this.data.sex)
},
//星座逻辑
showPop1: function () {
this.hidestarModal()
var t = this;
wx.showLoading({
title: "获取中...."
}), wx.cloud.callFunction({
name: "user",
data: {
action: "getStarCode",
gender: this.data.sex,
selectedStar: this.data.selectedStar
},
success: function (e) {
console.log("[云函数]getcode", e), -1 == e.result.code ? wx.showToast({
icon: "none",
title: t.data.contactTip
}) : 0 == e.result.code ? wx.showToast({
icon: "none",
title: "请先登记,再来匹配"
}) : (
t.setData({
suiji : Math.ceil(Math.random()*e.result.data.length),
isShowModal: !0,
userInfo: e.result.data
}), wx.hideLoading({
success: function (t) {}
}),
console.log(t.data.suiji),
console.log(t.data.userInfo[t.data.suiji]),
t.setData({
userInfo: t.data.userInfo[t.data.suiji]
})
);
},
fail: function (t) {
wx.hideLoading({
success: function (t) {}
}), console.error("[云函数] [getcode] 调用失败", t);
}
});
},
pay1(payData) {
let that = this;
//官方标准的支付方法
wx.requestPayment({
timeStamp: payData.timeStamp,
nonceStr: payData.nonceStr,
package: payData.package, //统一下单接口返回的 prepay_id 格式如:prepay_id=***
signType: 'MD5',
paySign: payData.paySign, //签名
success(res) {
console.log("支付成功", res)
, that.showPop1();
},
fail(res) {
console.log("支付失败", res)
},
complete(res) {
console.log("支付完成", res)
}
})
},
createOrder1: function() {
let that = this;
wx.cloud.callFunction({
name: "pay",
data: {
money: that.data.index
},
success(res) {
console.log("提交成功", res.result)
that.pay1(res.result)
},
fail(res) {
console.log("提交失败", res)
}
})
},
//星座
confirmStarChange: function () {
"" != this.data.selectedStar ? (this.setData({
isShowSelectModal: !1
}), this.createOrder1()) : wx.showToast({
title: "请选择意向星座"
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
这个小程序是云开发的不需要服务器域名 支持流量主wx支付。超级能吸引年轻人的一款小程序 版本新增: 1.Ui美化 2.星座匹配(通过星座进行盲盒) 3.后台管理(可以实时看到用户数量) 4.支付S I P 9功能(后台可以设置支付金额) 5.骗审核模式(可以快速帮助大家通过小程序审核实现上线) 企业小程序可以对接wx支付,非企业小程序只能流量主。
资源推荐
资源详情
资源评论
收起资源包目录
交友盲盒小程序版本.rar (120个子文件)
init.bat 27B
.DS_Store 8KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
index.js 11KB
pen.js 10KB
index.js 10KB
home.js 10KB
downloader.js 7KB
painter.js 7KB
index.js 3KB
cloudfunctionVSdatabaseAPI.js 3KB
savebox.js 2KB
index.js 2KB
index.js 2KB
createForOfIteratorHelper.js 1KB
app.js 1KB
util.js 1KB
index.js 1KB
objectSpread2.js 898B
cu-custom.js 878B
index.js 869B
index.js 845B
index.js 706B
unsupportedIterableToArray.js 524B
toConsumableArray.js 410B
createClass.js 401B
typeof.js 388B
util.js 341B
index.js 238B
index.js 236B
defineProperty.js 233B
nonIterableSpread.js 232B
arrayLikeToArray.js 201B
arrayWithoutHoles.js 181B
iterableToArray.js 160B
classCallCheck.js 154B
interopRequireDefault.js 143B
envList.js 127B
NB3m3Om8Nm8kCq21sZt3FmVgS1jOfYF3-export-format.json 53KB
package-lock.json 32KB
schema-export-zpou6iax.json 5KB
project.config.json 1KB
site.json 982B
app.json 575B
package.json 279B
package.json 257B
package.json 256B
package.json 256B
package.json 254B
savebox.json 243B
package.json 241B
sitemap.json 235B
sitemap80.json 186B
home.json 121B
index.json 110B
painter.json 110B
index.json 110B
cu-custom.json 110B
shenhe.json 102B
index.json 87B
index.json 87B
config.json 49B
config.json 49B
config.json 49B
config.json 49B
config.json 49B
cloudfunctionVSdatabaseAPI.json 27B
index.json 27B
banner_img8.png 189KB
163239828798287372.png 104KB
banner_imgs1.png 84KB
banner_img6.png 51KB
banner_img4.png 41KB
banner_img3.png 33KB
banner_img7.png 32KB
banner_img2.png 31KB
index_shige.png 30KB
banner_img5.png 26KB
huawen_banner.png 16KB
index_img.png 16KB
banner_img9.png 16KB
banner_img10.png 12KB
nvxing.png 11KB
nanxing.png 11KB
empty.png 10KB
tip.png 9KB
konghezi.png 7KB
py.png 3KB
female.png 2KB
man.png 2KB
s.png 2KB
refresh.png 2KB
download.png 883B
index.wxml 13KB
共 120 条
- 1
- 2
资源评论
小正太浩二
- 粉丝: 183
- 资源: 5909
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功