代码添加

main
123456 2 days ago
parent 8820aeffff
commit ab393e893c
  1. 2
      androidPrivacy.json
  2. 125
      api/iap.js
  3. 8
      api/index.js
  4. 4
      api/socket.js
  5. 18
      manifest.json
  6. 140
      pages/users/center/index.vue
  7. 2
      pages/users/help/index.vue
  8. 150
      pages/users/recharge/index.vue
  9. 2
      unpackage/cache/appleConfig.ini
  10. 4
      unpackage/cache/certdataios
  11. 2
      unpackage/dist/build/app-plus/androidPrivacy.json
  12. 8
      unpackage/dist/build/app-plus/app-service.js
  13. 6
      unpackage/dist/build/app-plus/app-view.js
  14. 2
      unpackage/dist/build/app-plus/manifest.json
  15. 2
      unpackage/dist/build/app-plus/pages/pipei/shipin/detail.js
  16. 2
      unpackage/dist/build/app-plus/pages/users/renzheng/camera.js
  17. 2
      unpackage/dist/dev/app-plus/androidPrivacy.json
  18. 6126
      unpackage/dist/dev/app-plus/app-service.js
  19. 15531
      unpackage/dist/dev/app-plus/app-view.js
  20. 2
      unpackage/dist/dev/app-plus/manifest.json
  21. 250
      unpackage/dist/dev/app-plus/pages/pipei/shipin/detail.js
  22. 110
      unpackage/dist/dev/app-plus/pages/users/renzheng/camera.js
  23. 2
      新建文本文档.txt

@ -2,7 +2,7 @@
"version" : "1",
"prompt" : "template",
"title" : "服务协议与隐私政策",
"message" : "\t <br/>\r\r
"message" : "\t <br/>\r\r\r
\t <a href=\"https://api.lyiyuan.cn/profile/upload/web/index.html#/pages/users/about/index?type=CONFIG_USER_AGREEMENT\">《用户协议》</a> 与 <a href=\"https://api.lyiyuan.cn/profile/upload/web/index.html#/pages/users/about/index?type=CONFIG_PRIVACY_POLICY\">《隐私政策》</a>了解详细信息。如你同意,请点击“我同意”开始接受我们的服务。",
"buttonAccept" : "同意并接受",
"buttonRefuse" : "暂不同意",

@ -0,0 +1,125 @@
const ProviderType = {
IAP: 'iap'
}
const IapTransactionState = {
purchasing: "0", // A transaction that is being processed by the App Store.
purchased: "1", // A successfully processed transaction.
failed: "2", // A failed transaction.
restored: "3", // A transaction that restores content previously purchased by the user.
deferred: "4" // A transaction that is in the queue, but its final status is pending external action such as Ask to Buy.
};
class Iap {
_channel = null;
_channelError = null;
_productIds = [];
_ready = false;
constructor({
products
}) {
this._productIds = products;
}
init() {
return new Promise((resolve, reject) => {
this.getChannels((channel) => {
this._ready = true;
resolve(channel);
}, (err) => {
reject(err);
})
})
}
getProduct(productIds) {
return new Promise((resolve, reject) => {
this._channel.requestProduct(productIds || this._productIds, (res) => {
console.log("requestProduct",res)
resolve(res);
}, (err) => {
reject(err);
})
});
}
requestPayment(orderInfo) {
return new Promise((resolve, reject) => {
uni.requestPayment({
provider: 'appleiap',
orderInfo: orderInfo,
success: (res) => {
resolve(res);
},
fail: (err) => {
reject(err);
}
});
});
}
restoreCompletedTransactions(username) {
return new Promise((resolve, reject) => {
this._channel.restoreCompletedTransactions({
manualFinishTransaction: true,
username
}, (res) => {
resolve(res);
}, (err) => {
reject(err);
})
});
}
finishTransaction(transaction) {
return new Promise((resolve, reject) => {
this._channel.finishTransaction(transaction, (res) => {
resolve(res);
}, (err) => {
reject(err);
});
});
}
getChannels(success, fail) {
if (this._channel !== null) {
success(this._channel)
return
}
if (this._channelError !== null) {
fail(this._channelError)
return
}
uni.getProvider({
service: 'payment',
success: (res) => {
this._channel = res.providers.find((channel) => {
return (channel.id === 'appleiap')
})
if (this._channel) {
success(this._channel)
} else {
this._channelError = {
errMsg: 'paymentContext:fail iap service not found'
}
fail(this._channelError)
}
}
});
}
get channel() {
return this._channel;
}
}
export {
Iap,
IapTransactionState
}

@ -1,5 +1,13 @@
import { request } from './request'
const api = {
//苹果内购
iosPayReceipt(data) {
return request({
url: 'api/user/iosPayReceipt',
method: 'post',
data
})
},
//视频语音匹配
costDescription(data) {
return request({

@ -1,4 +0,0 @@
const socket = {
}
export default socket

@ -2,8 +2,8 @@
"name" : "纯玩",
"appid" : "__UNI__7C06BEE",
"description" : "用心交友",
"versionName" : "1.0.0",
"versionCode" : "100",
"versionName" : "1.0.2",
"versionCode" : 102,
"transformPx" : false,
/* 5+App */
"app-plus" : {
@ -61,13 +61,13 @@
"dSYMs" : false,
"UIBackgroundModes" : [ "audio" ],
"privacyDescription" : {
"NSPhotoLibraryUsageDescription" : "获取用户相册方便用户上传照片",
"NSPhotoLibraryAddUsageDescription" : "获取用户相册方便用户上传照片",
"NSCameraUsageDescription" : "打开摄像头进行视频聊天",
"NSMicrophoneUsageDescription" : "打开麦克风方便用户录音说话",
"NSLocationWhenInUseUsageDescription" : "获取用户当前位置",
"NSLocationAlwaysUsageDescription" : "实时获取用户位置",
"NSLocationAlwaysAndWhenInUseUsageDescription" : "获取用户当前位置",
"NSPhotoLibraryUsageDescription" : "为了方便您上传图片和视频,我们需要请求您的相册权限",
"NSPhotoLibraryAddUsageDescription" : "为了方便您上传图片和视频,我们需要请求您的相册权限",
"NSCameraUsageDescription" : "打开摄像头进行视频聊天,,我们需要请求您的摄像头权限",
"NSMicrophoneUsageDescription" : "打开麦克风方便用户录音说话,我们需要请求您的录音权限",
"NSLocationWhenInUseUsageDescription" : "为了方便推荐给您附近的人和消息,我们需要请求您的位置信息",
"NSLocationAlwaysUsageDescription" : "为了方便推荐给您附近的人和消息,我们需要请求您的位置信息",
"NSLocationAlwaysAndWhenInUseUsageDescription" : "为了方便推荐给您附近的人和消息,我们需要请求您的位置信息",
"NSAppleMusicUsageDescription" : "获取用户文件"
},
"urltypes" : "com.chunwen"

@ -139,7 +139,7 @@
<view class="agreement">
<image class="img1" @click="toggleImg()" v-if="isToggle" src="@/static/icon-check-on.png"></image>
<image class="img2" @click="toggleImg()" v-else src="@/static/icon-check.png"></image>
请阅读并同意<text @click="openPage()">会员协议</text>
请阅读并同意<text @click="openPage(1)">会员协议</text><text @click="openPage(2)">自动续费协议</text>
</view>
</view>
<view class="task-fd" v-if="payInfo && payInfo.length >= 1">
@ -167,7 +167,8 @@
},
payInfo: [],
payType: "",
huiyuanInfo: {}
huiyuanInfo: {},
productList: []
};
},
onReady() {
@ -178,10 +179,16 @@
this.getConfigData();
},
methods: {
openPage() {
uni.navigateTo({
url: "/pages/users/about/index?type=CONFIG_MEMBERSHIP_AGREEMENT"
})
openPage(index) {
if(index == 1){
uni.navigateTo({
url: "/pages/users/about/index?type=CONFIG_MEMBERSHIP_AGREEMENT"
})
}else{
uni.navigateTo({
url: "/pages/users/about/index?type=AUTO_RENEWAL_MEMBER_URL"
})
}
},
tabItem(i){
this.tabIndex = i;
@ -268,24 +275,6 @@
return ;
}
}
if(this.platform == 'ios'){
if(this.payType == 'ios-1'){
uni.getProvider({
service: 'payment',
success: (res) => {
const iapChannel = res.providers.find((channel) => {
console.log(channel)
return (channel.id === 'appleiap')
})
// iapChannel nulliapHBuilder iap
console.log(res)
}
});
}
return ;
}
uni.showLoading({
title: "正在支付"
})
@ -294,6 +283,52 @@
memberId: that.list[that.tabIndex].id
})
if(code == 200){
if(this.platform == 'ios'){
if(this.payType == 'ios-1'){
uni.getProvider({
service: 'payment',
success: (res) => {
var ids = ['chunwan_pro_01', 'chunwan_pro_02', 'chunwan_pro_03']
plus.payment.getChannels((channels) => {
console.log(channels);
for (var i in channels) {
var channel = channels[i];
if (channel.id == 'appleiap'){
console.log("苹果",channel)
let iap = channel;
//
iap.requestOrder(ids, function(orderList){
// iap
console.log('requestOrder success: ' + JSON.stringify(orderList))
that.productList = orderList
if(that.productList && that.productList.length >0){
that.productList = that.productList.sort((a,b)=>{
return a.price - b.price
})
}
that.applePay(msg,that.productList[that.tabIndex])
},function(e){
console.log('requestOrder failed: ' + JSON.stringify(e));
// console.log(' iap ')
uni.showToast({
icon: "none",
position: "bottom",
title: "暂不支持苹果 iap 支付"
})
});
}
}
}, function(e) {
console.log("获取iap支付通道失败:" + e.message);
});
return ;
}
});
return ;
}
}
that.toPay(msg);
}else{
uni.hideLoading()
@ -304,6 +339,63 @@
})
}
},
async applePay(orderId,orderInfo){
const that = this;
console.log("applePay", orderId,orderInfo )
uni.requestPayment({
provider: 'appleiap',
orderInfo: {
productid: orderInfo.productid,
username: orderId, //
optimize: true // optimize: true
},
/*
orderInfo可传参数一览
productid: (String 类型 )(必填) 商品的标识你在苹果那里添加的商品标识
username: (String 类型 )(可选) 购买用户名称我喜欢在这里传入订单号这样支付成功时就可以获得订单号
quantity: (String 类型 )(可选) 商品数量默认为 "1"
optimize:(Boolean)(可选) HX 3.1.10 版本新增参数解决用户未绑定支付方式造成的丢单问题
*/
success: async (res) => {
// uni.LTY.loaded();
uni.hideLoading();
console.log("success",res)
const respone = await that.$api.iosPayReceipt({
outTradeNo: orderId,
receipt: res
});
console.log(respone)
if(respone.code == 200){
uni.showToast({
title: "支付成功"
})
}else{
uni.showToast({
icon: "none",
position: "bottom",
title: respone.msg
})
}
},
fail: (e) => {
console.log("fail",e)
// uni.LTY.loaded();
uni.hideLoading();
uni.showToast({
icon: "none",
position: "bottom",
title: "取消支付"
})
},
complete: () => {
console.log("payment结束");
// this.payShow = false;
// this.payShow2 = false;
}
})
},
//
async toPay(outTradeNo) {
const that = this;

@ -12,7 +12,7 @@
</view>
</view>
<view class="dd">
<view class="item" v-for="(b,idx) in a.contentList" :key="idx" @click="toPage(a)">
<view class="item" v-for="(b,idx) in a.contentList" :key="idx" @click.stop="toPage(b)">
{{b.title}}<image src="@/static/icon-help-right.png"></image>
</view>
</view>

@ -6,11 +6,11 @@
<view class="recharge-hd">
<text>{{userInfo.goldCoins}}</text>金币余额
</view>
<view class="recharge-bd">
<view class="item" v-for="(a,index) in list" :key="index">
<image src="@/static/coins.png"></image>
<view class="info"><view class="num"><text>{{a.coins}}{{a.giveCoins?("+"+a.giveCoins):""}}</text>金币</view v-if="a.giveCoins">{{a.giveCoins}}</view>
<view class="btn" @click="toOpen(a)">{{a.price}}</view>
<view class="recharge-bd">
<view class="item" v-for="(a,index) in list" :key="index">
<image src="@/static/coins.png"></image>
<view class="info"><view class="num"><text>{{a.coins}}{{a.giveCoins?("+"+a.giveCoins):""}}</text>金币</view v-if="a.giveCoins">{{a.giveCoins}}</view>
<view class="btn" @click="toOpen(a,index)">{{a.price}}</view>
</view>
</view>
<view class="tips">提示:请勿相信非官方渠道的充值信息禁止未成年人充值!请理性消费谨防诈骗行为参考平台公约防诈骗指南点击充值即表示您已同意充值协议</view>
@ -54,7 +54,11 @@
</template>
<script>
const systemInfo = uni.getSystemInfoSync();
const systemInfo = uni.getSystemInfoSync();
import {
Iap,
IapTransactionState
} from "@/api/iap.js"
export default {
data() {
return {
@ -71,7 +75,9 @@
list: [],
userInfo: {},
payInfo: [],
obj: {}
obj: {},
paysIndex: 0,
productList: []
}
},
onReady() {
@ -85,8 +91,9 @@
})
},
methods: {
toOpen(o) {
this.show = true;
toOpen(o,i) {
this.show = true;
this.paysIndex = i;
this.obj = o;
},
tabItem(index,a){
@ -121,33 +128,7 @@
return ;
}
}
if(this.platform == 'ios'){
if(this.payType == 'ios-1'){
plus.payment.getChannels((channels) => {
console.log(channels);
for (var i in channels) {
var channel = channels[i];
if (channel.id == 'appleiap'){
console.log("苹果")
let iap = channel;
//
iap.requestOrder(['chunwanProPackage'], function(orderList){
// iap
console.log('requestOrder success: ' + JSON.stringify(orderList))
// that.applePay(orderList[0])
},function(e){
console.log('requestOrder failed: ' + JSON.stringify(e));
// console.log(' iap ')
});
}
}
}, function(e) {
console.log("获取iap支付通道失败:" + e.message);
});
return ;
}
}
that.show = false;
that.tabIndex = -1;
uni.showLoading({
@ -157,7 +138,45 @@
userId: uni.getStorageSync("userInfo").id,
mealsetId: this.obj.id
})
if(code == 200){
if(code == 200){
if(this.platform == 'ios'){
if(this.payType == 'ios-1'){
var ids = ['chunwan_coin_01', 'chunwan_coin_02', 'chunwan_coin_03', 'chunwan_coin_04', 'chunwan_coin_05', 'chunwan_coin_06', 'chunwan_coin_07']
plus.payment.getChannels((channels) => {
console.log(channels);
for (var i in channels) {
var channel = channels[i];
if (channel.id == 'appleiap'){
console.log("苹果",channel)
let iap = channel;
//
iap.requestOrder(ids, function(orderList){
// iap
console.log('requestOrder success: ' + JSON.stringify(orderList))
that.productList = orderList
if(that.productList && that.productList.length >0){
that.productList = that.productList.sort((a,b)=>{
return a.price - b.price
})
}
that.applePay(msg,that.productList[that.paysIndex])
},function(e){
console.log('requestOrder failed: ' + JSON.stringify(e));
// console.log(' iap ')
uni.showToast({
icon: "none",
position: "bottom",
title: "暂不支持苹果 iap 支付"
})
});
}
}
}, function(e) {
console.log("获取iap支付通道失败:" + e.message);
});
return ;
}
}
that.toPay(msg);
}else{
uni.showToast({
@ -166,6 +185,63 @@
title: msg
})
}
},
async applePay(orderId,orderInfo){
const that = this;
console.log("applePay", orderId,orderInfo )
uni.requestPayment({
provider: 'appleiap',
orderInfo: {
productid: orderInfo.productid,
username: orderId, //
optimize: true // optimize: true
},
/*
orderInfo可传参数一览
productid: (String 类型 )(必填) 商品的标识你在苹果那里添加的商品标识
username: (String 类型 )(可选) 购买用户名称我喜欢在这里传入订单号这样支付成功时就可以获得订单号
quantity: (String 类型 )(可选) 商品数量默认为 "1"
optimize:(Boolean)(可选) HX 3.1.10 版本新增参数解决用户未绑定支付方式造成的丢单问题
*/
success: async (res) => {
console.log("success",res)
const respone = await that.$api.iosPayReceipt({
outTradeNo: orderId,
receipt: res
});
uni.hideLoading()
console.log(respone)
if(respone.code == 200){
uni.showToast({
title: "支付成功"
})
}else{
uni.showToast({
icon: "none",
position: "bottom",
title: respone.msg
})
}
},
fail: (e) => {
console.log("fail",e)
// uni.LTY.loaded();
uni.hideLoading();
uni.showToast({
icon: "none",
position: "bottom",
title: "取消支付"
})
},
complete: () => {
console.log("payment结束");
// this.payShow = false;
// this.payShow2 = false;
}
})
},
//
async toPay(outTradeNo) {

@ -2,7 +2,7 @@
appleAppid=com.chunwan
[appstore]
appstore=7864148d0dcea463a7d348b03defd004
appstore=
[iosStyle]
iosStyle=

@ -1,3 +1,3 @@
iosProfile=D:/仁周项目/2024-09-06 陪玩陪俩(纯玩)项目/chunwan/发布-ios_app_store.mobileprovision
ioscertFile=D:/仁周项目/2024-09-06 陪玩陪俩(纯玩)项目/chunwan/发布-ios_distribution-p12/CXG3W4G273-ios_distribution.p12
iosProfile=D:/work/2024-11-28 纯玩/chunwan/发布-ios_app_store.mobileprovision
ioscertFile=D:/work/2024-11-28 纯玩/chunwan/发布-ios_distribution-p12/CXG3W4G273-ios_distribution.p12
ioscertPassword=ffGC+00MkDTQ00zBfErOag==

@ -2,7 +2,7 @@
"version" : "1",
"prompt" : "template",
"title" : "服务协议与隐私政策",
"message" : "\t <br/>\r\r
"message" : "\t <br/>\r\r\r
\t <a href=\"https://api.lyiyuan.cn/profile/upload/web/index.html#/pages/users/about/index?type=CONFIG_USER_AGREEMENT\">《用户协议》</a> 与 <a href=\"https://api.lyiyuan.cn/profile/upload/web/index.html#/pages/users/about/index?type=CONFIG_PRIVACY_POLICY\">《隐私政策》</a>了解详细信息。如你同意,请点击“我同意”开始接受我们的服务。",
"buttonAccept" : "同意并接受",
"buttonRefuse" : "暂不同意",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -2,7 +2,7 @@
"version" : "1",
"prompt" : "template",
"title" : "服务协议与隐私政策",
"message" : "\t <br/>\r\r
"message" : "\t <br/>\r\r\r
\t <a href=\"https://api.lyiyuan.cn/profile/upload/web/index.html#/pages/users/about/index?type=CONFIG_USER_AGREEMENT\">《用户协议》</a> 与 <a href=\"https://api.lyiyuan.cn/profile/upload/web/index.html#/pages/users/about/index?type=CONFIG_PRIVACY_POLICY\">《隐私政策》</a>了解详细信息。如你同意,请点击“我同意”开始接受我们的服务。",
"buttonAccept" : "同意并接受",
"buttonRefuse" : "暂不同意",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +1 @@
https://doc.apipost.net/docs/detail/35f67e647c03000?target_id=570a8c3
https://doc.apipost.net/docs/detail/35f67d9ed4e5000?target_id=56b5ce4
Loading…
Cancel
Save