优惠卷领取动画,微信支付接口
This commit is contained in:
parent
2f7b338d00
commit
a2c305591f
101
app.json
101
app.json
@ -1,53 +1,52 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/login/login",
|
||||
"pages/index/index",
|
||||
"pages/treaty/privacy/privacy",
|
||||
"pages/treaty/service/service",
|
||||
"pages/mine/mineIndex/mine",
|
||||
"pages/copyright/createProjectInfo/createProjectInfo",
|
||||
"pages/copyright/createBuy/createBuy",
|
||||
"pages/copyright/payment/payment",
|
||||
"pages/mine/mineAccount/mineCoupons/mineCoupons",
|
||||
"pages/copyright/publicPay/publicPay",
|
||||
"pages/copyright/common/payState",
|
||||
"pages/readTxt/readTxt",
|
||||
"pages/mine/mineAccount/mineInfo/mineInfo",
|
||||
"pages/mine/mineAccount/mineOrder/mineOrder",
|
||||
"pages/mine/mineAccount/mineContact/mineContact",
|
||||
"pages/treaty/rule/rule"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "AI喵著",
|
||||
"navigationBarBackgroundColor": "#ffffff"
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#515151",
|
||||
"selectedColor": "#FE9944",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"text": "首页",
|
||||
"iconPath": "/static/images/ic_home_normal.png",
|
||||
"selectedIconPath": "/static/images/ic_home_select.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/mine/mineIndex/mine",
|
||||
"text": "我的",
|
||||
"iconPath": "/static/images/ic_mine_normal.png",
|
||||
"selectedIconPath": "/static/images/ic_mine_select.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": "v2",
|
||||
"componentFramework": "glass-easel",
|
||||
"sitemapLocation": "sitemap.json",
|
||||
"lazyCodeLoading": "requiredComponents",
|
||||
"usingComponents": {
|
||||
"ad-popup": "./components/ad-popup/ad-popup"
|
||||
},
|
||||
"useExtendedLib": {
|
||||
"weui": true
|
||||
}
|
||||
"pages": [
|
||||
"pages/login/login",
|
||||
"pages/index/index",
|
||||
"pages/treaty/privacy/privacy",
|
||||
"pages/treaty/service/service",
|
||||
"pages/mine/mineIndex/mine",
|
||||
"pages/copyright/createProjectInfo/createProjectInfo",
|
||||
"pages/copyright/createBuy/createBuy",
|
||||
"pages/copyright/payment/payment",
|
||||
"pages/mine/mineAccount/mineCoupons/mineCoupons",
|
||||
"pages/copyright/publicPay/publicPay",
|
||||
"pages/copyright/common/payState",
|
||||
"pages/readTxt/readTxt",
|
||||
"pages/mine/mineAccount/mineInfo/mineInfo",
|
||||
"pages/mine/mineAccount/mineOrder/mineOrder",
|
||||
"pages/mine/mineAccount/mineContact/mineContact",
|
||||
"pages/treaty/rule/rule"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "AI喵著",
|
||||
"navigationBarBackgroundColor": "#ffffff"
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#515151",
|
||||
"selectedColor": "#FE9944",
|
||||
"list": [{
|
||||
"pagePath": "pages/index/index",
|
||||
"text": "首页",
|
||||
"iconPath": "/static/images/ic_home_normal.png",
|
||||
"selectedIconPath": "/static/images/ic_home_select.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/mine/mineIndex/mine",
|
||||
"text": "我的",
|
||||
"iconPath": "/static/images/ic_mine_normal.png",
|
||||
"selectedIconPath": "/static/images/ic_mine_select.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"style": "v2",
|
||||
"componentFramework": "glass-easel",
|
||||
"sitemapLocation": "sitemap.json",
|
||||
"lazyCodeLoading": "requiredComponents",
|
||||
"usingComponents": {
|
||||
"ad-popup": "./components/ad-popup/ad-popup"
|
||||
},
|
||||
"useExtendedLib": {
|
||||
"weui": true
|
||||
}
|
||||
}
|
@ -17,7 +17,25 @@ Component({
|
||||
}
|
||||
},
|
||||
data: {
|
||||
checked: false
|
||||
checked: false,
|
||||
initPosition: {
|
||||
left: 50,
|
||||
top: 50
|
||||
},
|
||||
animation: {},
|
||||
screenWidth: 0,
|
||||
screenHeight: 0
|
||||
},
|
||||
lifetimes: {
|
||||
ready() {
|
||||
const systemInfo = wx.getWindowInfo()
|
||||
this.screenWidth = systemInfo.windowWidth;
|
||||
this.screenHeight = systemInfo.windowHeight;
|
||||
this.setData({
|
||||
screenHeight: systemInfo.windowHeight,
|
||||
screenWidth: systemInfo.windowWidth
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggleCheck() {
|
||||
@ -33,10 +51,47 @@ Component({
|
||||
this.triggerEvent('close', this.data.checked); // 触发关闭事件
|
||||
},
|
||||
onFurl() {
|
||||
this.setData({
|
||||
visible: false
|
||||
})
|
||||
this.startAnimation()
|
||||
this.triggerEvent('furl', this.data.checked); //触发收下试卷
|
||||
},
|
||||
startAnimation() {
|
||||
// 先重置元素状态
|
||||
this.setData({
|
||||
showBox: true,
|
||||
animation: {}
|
||||
});
|
||||
// 短暂延迟确保重置完成
|
||||
setTimeout(() => {
|
||||
const animation = wx.createAnimation({
|
||||
duration: 1000,
|
||||
timingFunction: 'ease-in-out'
|
||||
});
|
||||
const targetLeft = this.data.screenWidth - 170;
|
||||
const targetTop = this.data.screenHeight - 170;
|
||||
console.log(this.data.screenHeight)
|
||||
console.log(this.data.screenWidth)
|
||||
animation
|
||||
.translate(targetLeft - this.data.initPosition.left, targetTop - this.data.initPosition.top)
|
||||
.scale(0.03)
|
||||
.rotate(180)
|
||||
.skew(10, 10)
|
||||
.opacity(0)
|
||||
.step();
|
||||
this.setData({
|
||||
animation: animation.export()
|
||||
});
|
||||
// 动画结束后隐藏元素
|
||||
setTimeout(() => {
|
||||
this.setData({
|
||||
visible: false,
|
||||
initPosition: {
|
||||
left: 50,
|
||||
top: 50
|
||||
},
|
||||
animation: {}
|
||||
});
|
||||
}, 1000);
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
})
|
@ -1,5 +1,5 @@
|
||||
<view class="ad-popup" wx:if="{{visible}}">
|
||||
<view class="ad-content">
|
||||
<view class="ad-content" animation="{{animation}}" style="left: {{initPosition.left}};top:{{initPosition.top}}">
|
||||
<view class="ic-close close-icon" bind:tap="onClose"></view>
|
||||
<view class="image-box">
|
||||
<view class="ad-bg img"></view>
|
||||
|
@ -7,6 +7,7 @@ const apiPath = {
|
||||
getPayOrder: '/api/pay/get-pay', //获取支付订单
|
||||
enterprisePay: '/api/pay/pay-account-recharge/${accountRechargeId}', //企业付款完成支付
|
||||
enterpriseAccountInfo: '/api/pay/get-pay-system-bank', //获取公司账户信息
|
||||
wxPayParams: '/api/accountrecharge/save-wx-pay-prepay-id', //获取微信支付所需参数 rechargeMoney金额 packageInfoId套餐包ID
|
||||
}
|
||||
class PayService {
|
||||
static doGetBuyPackageList(type, data) {
|
||||
@ -26,6 +27,10 @@ class PayService {
|
||||
static doGetOrder(data) {
|
||||
return request(apiPath.getPayOrder, "POST", data)
|
||||
}
|
||||
//获取微信支付参数
|
||||
static doGetWxPayParams(data) {
|
||||
return request(apiPath.wxPayParams, "POST", data, null, "operator")
|
||||
}
|
||||
}
|
||||
|
||||
export default PayService;
|
@ -2,6 +2,7 @@ const Cache = require('../utils/storage');
|
||||
// 定义api服务地址
|
||||
// const baseUrl = 'https://www.xzszwhy.cn/daqi/app';
|
||||
const operatorUrl = 'http://192.168.0.15:8091/operator';
|
||||
// const operatorUrl = 'https://www.aimzhu.com/operator';
|
||||
const copyrightUrl = 'http://192.168.0.15:7025/copyright';
|
||||
const uploadImgUrl = copyrightUrl + '/api/file/v2/upload-image'
|
||||
const previewUrl = copyrightUrl + '/route/file/v2/download/true/'
|
||||
|
@ -52,6 +52,14 @@ Page({
|
||||
wx.setNavigationBarTitle({
|
||||
title: '创建软著',
|
||||
})
|
||||
wx.setNavigationBarColor({
|
||||
frontColor: '#000000', // 必写项,字体颜色仅支持#ffffff和#000000
|
||||
backgroundColor: '#F0F0F0', // 传递的颜色值,仅支持十六进制颜色
|
||||
animation: { // 可选项
|
||||
duration: 500,
|
||||
timingFunc: 'easeIn'
|
||||
}
|
||||
})
|
||||
const typeParams = options.type //类型
|
||||
const priceParams = options.price //价格
|
||||
const isUrgentParams = options.isUrgent
|
||||
|
@ -61,7 +61,7 @@
|
||||
</view>
|
||||
<view wx:if="{{canSelCoupons}}" class="item">
|
||||
<text class="label">优惠券</text>
|
||||
<text style="flex:1;text-align: right;padding-right: 10px;color: #555;font-size: 14px;">{{selectCoupons.id? selectCoupons.id : '请选择优惠券'}}</text>
|
||||
<text bindtap="doShowCoupons" style="flex:1;text-align: right;padding-right: 10px;color: #555;font-size: 14px;">{{selectCoupons.couponId? selectCoupons.coupon.title : '请选择优惠券'}}</text>
|
||||
<text class="link" wx:if="{{!tools.isEmpty(selectCoupons)}}" bind:tap="clearSelectPackageOrCoupons">取消</text>
|
||||
<text class="link" bindtap="doShowCoupons" wx:if="{{tools.isEmpty(selectCoupons)}}">选择</text>
|
||||
</view>
|
||||
@ -133,7 +133,7 @@
|
||||
</view>
|
||||
<text>优惠卷</text>
|
||||
</view>
|
||||
<view>减{{amount/100}}元</view>
|
||||
<view>减{{item.coupon.amount/100}}元</view>
|
||||
</view>
|
||||
<view class="ticket-content">{{item.coupon.title}}</view>
|
||||
<view class="ticket-desc">有效期:{{item.coupon.useGmtStart}}至{{item.coupon.useGmtEnd}}</view>
|
||||
|
@ -1,3 +1,7 @@
|
||||
page {
|
||||
background: linear-gradient(to bottom, #F0F0F0, #FFFFFF);
|
||||
}
|
||||
|
||||
.create-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -77,6 +81,7 @@
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
padding-right: 10px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.desc .icon {
|
||||
|
@ -70,7 +70,8 @@ Page({
|
||||
if (regex.test(inputValue)) {
|
||||
//数字
|
||||
_self.setData({
|
||||
payMoney: e.detail.value
|
||||
payMoney: e.detail.value,
|
||||
selectBag: {}
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
@ -79,7 +80,8 @@ Page({
|
||||
success: () => {
|
||||
setTimeout(() => {
|
||||
_self.setData({
|
||||
payMoney: 100
|
||||
payMoney: 100,
|
||||
selectBag: {}
|
||||
})
|
||||
}, 1000);
|
||||
}
|
||||
@ -117,14 +119,30 @@ Page({
|
||||
},
|
||||
//TODO 调用微信支付
|
||||
toWeChatPay() {
|
||||
|
||||
const _self = this
|
||||
wx.showLoading({
|
||||
title: '支付中...',
|
||||
})
|
||||
const data = {
|
||||
rechargeMoney: _self.data.payMoney,
|
||||
packageInfoId: _self.data.selectBag.packageInfoId ? _self.data.selectBag.packageInfoId : ''
|
||||
}
|
||||
PayService.doGetWxPayParams(data)
|
||||
.then(res => {
|
||||
wx.hideLoading()
|
||||
console.log(res)
|
||||
})
|
||||
.catch(err => {
|
||||
wx.hideLoading()
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
//去支付
|
||||
doPay() {
|
||||
const _self = this
|
||||
if (_self.data.payWay == '1') {
|
||||
//微信
|
||||
toWeChatPay()
|
||||
_self.toWeChatPay()
|
||||
} else {
|
||||
//对公 需要传递参数 选中套餐 or 直接冲钱
|
||||
const id = _self.data.selectBag.packageInfoId
|
||||
|
@ -117,12 +117,9 @@ Page({
|
||||
},
|
||||
//创建项目
|
||||
createCopy() {
|
||||
this.setData({
|
||||
showAd: true
|
||||
wx.navigateTo({
|
||||
url: '/pages/copyright/createBuy/createBuy',
|
||||
})
|
||||
// wx.navigateTo({
|
||||
// url: '/pages/copyright/createBuy/createBuy',
|
||||
// })
|
||||
},
|
||||
//充值
|
||||
goPayment() {
|
||||
@ -286,7 +283,7 @@ Page({
|
||||
const _self = this
|
||||
this.setData({
|
||||
showDownload: true,
|
||||
sysPreviewUrl: copyrightUrl + item.previewUrl,
|
||||
sysPreviewUrl: `${copyrightUrl}/${item.previewUrl}`,
|
||||
tempItem: item
|
||||
})
|
||||
},
|
||||
@ -465,7 +462,8 @@ Page({
|
||||
showSuccess: true,
|
||||
showAd: false
|
||||
})
|
||||
}, err => {
|
||||
})
|
||||
.catch(err => {
|
||||
wx.hideLoading()
|
||||
_self.setData({
|
||||
errorHint: err.msg ? err.msg : '本次领取操作未成功,请重新进入小程序后再次尝试。',
|
||||
|
@ -51,8 +51,8 @@
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<container-loading loadingState="{{listLoading}}" style="height: {{contentHeight+100}}rpx;" bindrefresh="doRefreshList">
|
||||
<scroll-view scroll-y="{{true}}" style="height: {{contentHeight+100}}rpx;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='30'>
|
||||
<container-loading loadingState="{{listLoading}}" style="height: {{contentHeight+110}}rpx;" bindrefresh="doRefreshList">
|
||||
<scroll-view scroll-y="{{true}}" style="height: {{contentHeight+110}}rpx;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='30'>
|
||||
<view class="list-content">
|
||||
<block wx:for="{{projectList}}" wx:key="index">
|
||||
<view class="list-item">
|
||||
@ -93,7 +93,6 @@
|
||||
<mp-half-screen-dialog show="{{showDownload}}" ext-class="custom-dialog">
|
||||
<view slot="title" style="font-size: 16px;font-weight: bold;">资料下载</view>
|
||||
<view slot="desc" style="margin-top: 10px;">
|
||||
<view class="hint">温馨提示:若您想把下载的文件留存到本地,打开预览页面后,在界面右上角操作栏内,选择使用其他软件打开或者保存文件功能就能实现。</view>
|
||||
<view class="download-desc">
|
||||
<view class="link-title">项目预览链接</view>
|
||||
<text class="link" selectable="true">{{sysPreviewUrl}}</text>
|
||||
@ -147,6 +146,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hint mt-10">温馨提示:若您想把下载的文件留存到本地,打开预览页面后,在界面右上角操作栏内,选择使用其他软件打开或者保存文件功能就能实现。</view>
|
||||
</view>
|
||||
</mp-half-screen-dialog>
|
||||
<down-progress isShow="{{downloading}}" progress="{{downloadProgress}}"></down-progress>
|
||||
|
@ -64,7 +64,7 @@
|
||||
.notice-box {
|
||||
background-color: #FFE5BC;
|
||||
margin-top: 20rpx;
|
||||
|
||||
border-radius: 3px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
@ -374,7 +374,8 @@
|
||||
.download-item:nth-of-type(n+2) {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.download-item:last-child{
|
||||
|
||||
.download-item:last-child {
|
||||
margin-bottom: 80px;
|
||||
}
|
||||
|
||||
@ -501,7 +502,8 @@
|
||||
color: rgb(248, 185, 50);
|
||||
font-weight: bold;
|
||||
}
|
||||
.weui-half-screen-dialog__ft{
|
||||
|
||||
.weui-half-screen-dialog__ft {
|
||||
height: 0;
|
||||
padding: 0;
|
||||
}
|
@ -139,7 +139,7 @@ page {
|
||||
}
|
||||
|
||||
.l-price {
|
||||
font-size: 30px;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
margin-left: 5px;
|
||||
}
|
||||
@ -157,9 +157,9 @@ page {
|
||||
.r-title {
|
||||
line-height: 25px;
|
||||
color: #313131;
|
||||
font-size: 18px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
text-align: center;
|
||||
font-family: PingFangSC-medium;
|
||||
}
|
||||
|
||||
|
@ -74,11 +74,11 @@ Page({
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
//获取账户余额
|
||||
getMinePackageCount() {
|
||||
const _self = this
|
||||
UserApi.doGetMinePackageCount()
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
_self.setData({
|
||||
allCount: res.ALL,
|
||||
materialCount: res.MATERIAL
|
||||
|
@ -34,8 +34,8 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="menu-box" style="height: {{contentHeight+180}}rpx;">
|
||||
<scroll-view scroll-y style="height: {{contentHeight+180}}rpx;">
|
||||
<view class="menu-box" style="height: {{contentHeight+190}}rpx;">
|
||||
<scroll-view scroll-y style="height: {{contentHeight+190}}rpx;">
|
||||
<view class="menu-container">
|
||||
<block wx:for="{{menuList}}" wx:key="index">
|
||||
<view class="menu-item" bind:tap="itemClick" data-path="{{item.path}}">
|
||||
|
@ -175,6 +175,16 @@ const removeImgStyleFromRichText = (richText) => {
|
||||
}
|
||||
return richText;
|
||||
}
|
||||
//生成32位随机字符串
|
||||
const random32Str = () => {
|
||||
const charSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
let randomString = '';
|
||||
for (let i = 0; i < 32; i++) {
|
||||
const randomIndex = Math.floor(Math.random() * charSet.length);
|
||||
randomString += charSet.charAt(randomIndex);
|
||||
}
|
||||
return randomString;
|
||||
}
|
||||
module.exports = {
|
||||
formatTime: formatTime,
|
||||
formatDate: formatDate,
|
||||
@ -185,5 +195,6 @@ module.exports = {
|
||||
formatHtml: formatRichText,
|
||||
removeImgStyle: removeImgStyleFromRichText,
|
||||
dateTimePicker: dateTimePicker,
|
||||
pxToRpx: pxToRpx
|
||||
pxToRpx: pxToRpx,
|
||||
random32Str: random32Str
|
||||
}
|
Loading…
Reference in New Issue
Block a user