优惠卷弹窗优化

This commit is contained in:
itgaojian163 2025-04-10 10:06:47 +08:00
parent 27408ba229
commit 3f5d1d021b
10 changed files with 68 additions and 46 deletions

View File

@ -22,19 +22,33 @@ Component({
left: 50, left: 50,
top: 50 top: 50
}, },
// top: 35%;
// left: 8%;
content: {
left: 20,
top: 150,
},
animation: {}, animation: {},
screenWidth: 0, screenWidth: 0,
screenHeight: 0 screenHeight: 0,
top: 590,
left: 80
}, },
lifetimes: { lifetimes: {
ready() { ready() {
const _self = this
const systemInfo = wx.getWindowInfo() const systemInfo = wx.getWindowInfo()
this.screenWidth = systemInfo.windowWidth;
this.screenHeight = systemInfo.windowHeight;
this.setData({ this.setData({
screenHeight: systemInfo.windowHeight, screenHeight: systemInfo.windowHeight,
screenWidth: systemInfo.windowWidth screenWidth: systemInfo.windowWidth
}) })
var phoneHeight = Math.floor(systemInfo.screenWidth / 750 * 100) / 100 //1rpx 是0.52px
this.setData({
'content.top': _self.data.top * phoneHeight,
'content.left': _self.data.left * phoneHeight
})
console.log('手机px', phoneHeight)
console.log('边距:', _self.data.content)
} }
}, },
methods: { methods: {

View File

@ -2,7 +2,7 @@
<view class="ad-content" animation="{{animation}}" style="left: {{initPosition.left}};top:{{initPosition.top}}"> <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="ic-close close-icon" bind:tap="onClose"></view>
<view class="image-box"> <view class="image-box">
<view class="ad-bg img"></view> <view class="ad-bg"></view>
<view class="content"> <view class="content">
<view class="price-box"> <view class="price-box">
<view class="p-icon">¥</view> <view class="p-icon">¥</view>

File diff suppressed because one or more lines are too long

View File

@ -84,7 +84,8 @@ Page({
//数字 //数字
_self.setData({ _self.setData({
payMoney: e.detail.value, payMoney: e.detail.value,
selectBag: {} selectBag: {},
currentTab: -1
}) })
} else { } else {
wx.showToast({ wx.showToast({

View File

@ -50,8 +50,8 @@
<view class="{{currentBagTab=='MATERIAL'?'bag-select':'bag-normal'}} border-left" bind:tap="doChangeBagTab" data-value="MATERIAL">写材料套餐包</view> <view class="{{currentBagTab=='MATERIAL'?'bag-select':'bag-normal'}} border-left" bind:tap="doChangeBagTab" data-value="MATERIAL">写材料套餐包</view>
<view class="{{currentBagTab=='ALL'?'bag-select':'bag-normal'}} border-right" bind:tap="doChangeBagTab" data-value="ALL">全托管套餐包</view> <view class="{{currentBagTab=='ALL'?'bag-select':'bag-normal'}} border-right" bind:tap="doChangeBagTab" data-value="ALL">全托管套餐包</view>
</view> </view>
<container-loading loadingState="{{listLoading}}" bindrefresh="doRefreshList"> <container-loading style="min-height: 40vh;" loadingState="{{listLoading}}" bindrefresh="doRefreshList">
<view class="bag-list"> <view class="bag-list" style="min-height: 40vh;">
<!-- 列表 --> <!-- 列表 -->
<block wx:for="{{bagList}}" wx:key="index"> <block wx:for="{{bagList}}" wx:key="index">
<view class="bag-item"> <view class="bag-item">

View File

@ -73,7 +73,7 @@ page {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: flex-start; justify-content: flex-start;
align-items: flex-end; align-items: baseline;
border-bottom: 1rpx solid #dbdada; border-bottom: 1rpx solid #dbdada;
font-weight: bold; font-weight: bold;
} }
@ -201,10 +201,17 @@ page {
.bag-item { .bag-item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
border: 1rpx solid #f2f2f2; border: 1rpx solid rgba(239, 239, 239, 1);
padding: 20rpx; padding: 20rpx;
} }
.bag-item:nth-of-type(n+2) {
border-top: none;
border-left: 1rpx solid rgba(239, 239, 239, 1);
border-right: 1rpx solid rgba(239, 239, 239, 1);
border-bottom: 1rpx solid rgba(239, 239, 239, 1);
}
.bag-item-title-box { .bag-item-title-box {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@ -251,9 +258,12 @@ page {
} }
.bag-item-desc-box .btn { .bag-item-desc-box .btn {
background-color: #FFC67D;
padding: 1px 15px; padding: 1px 15px;
color: white; color: white;
border-radius: 5px; border-radius: 47px;
font-size: 12px; background-color: rgba(255, 198, 125, 1);
color: rgba(255, 255, 255, 1);
font-size: 14px;
text-align: center;
font-family: PingFangSC-regular;
} }

View File

@ -469,5 +469,11 @@ Page({
showError: true, showError: true,
}) })
}) })
},
copyLink(e) {
var link = e.currentTarget.dataset.value
wx.setClipboardData({
data: link,
})
} }
}) })

View File

@ -95,7 +95,7 @@
<view slot="desc" style="margin-top: 10px;"> <view slot="desc" style="margin-top: 10px;">
<view class="download-desc"> <view class="download-desc">
<view class="link-title">项目预览链接</view> <view class="link-title">项目预览链接</view>
<text class="link" selectable="true">{{sysPreviewUrl}}</text> <text class="link" bind:tap="copyLink" data-value="{{sysPreviewUrl}}" selectable="true">{{sysPreviewUrl}}</text>
</view> </view>
<view class="download-item"> <view class="download-item">
<view class="download-title"> <view class="download-title">

View File

@ -43,7 +43,6 @@ Page({
} }
UserService.doLogin(data) UserService.doLogin(data)
.then(res => { .then(res => {
console.log(res)
wx.hideLoading() wx.hideLoading()
_self.setData({ _self.setData({
openId: res.openid openId: res.openid
@ -63,15 +62,12 @@ Page({
}) })
} }
}, err => { }, err => {
//TODO 发生未知错误,需要提醒重新进入小程序 // 发生未知错误,需要提醒重新进入小程序
console.log('doLogin')
console.log(err)
wx.hideLoading() wx.hideLoading()
_self.doShowExit() _self.doShowExit()
}) })
} else { } else {
//TODO 发生未知错误,需要提醒重新进入小程序 // 发生未知错误,需要提醒重新进入小程序
console.log('code null')
_self.doShowExit() _self.doShowExit()
} }
}, },
@ -105,7 +101,6 @@ Page({
}) })
}, },
onChange(e) { onChange(e) {
console.log(e)
this.setData({ this.setData({
isChecked: e.detail.value === '1' isChecked: e.detail.value === '1'
}); });
@ -118,7 +113,6 @@ Page({
const { const {
code code
} = e.detail; } = e.detail;
console.log(code)
//通过后台获取手机号 //通过后台获取手机号
wx.showLoading({ wx.showLoading({
title: '登录中...', title: '登录中...',
@ -127,7 +121,6 @@ Page({
"code": code, "code": code,
"openid": _self.data.openId "openid": _self.data.openId
} }
console.log(data)
UserService.doRegister(data) UserService.doRegister(data)
.then(res => { .then(res => {
wx.hideLoading() wx.hideLoading()
@ -150,8 +143,7 @@ Page({
_self.doShowExit() _self.doShowExit()
} }
}, err => { }, err => {
console.log(err) // 绑定失败重新
//TODO 绑定失败重新
wx.hideLoading() wx.hideLoading()
_self.doShowExit() _self.doShowExit()
}) })
@ -195,7 +187,6 @@ Page({
}, err => { }, err => {
wx.hideLoading() wx.hideLoading()
_self.doShowExit() _self.doShowExit()
console.log(err)
}) })
}, },
//联系人姓名 //联系人姓名
@ -248,7 +239,6 @@ Page({
this.setData({ this.setData({
isAgree: !this.data.isAgree isAgree: !this.data.isAgree
}) })
console.log(this.data.isAgree)
}, },
onUnload() { onUnload() {
console.log('login卸载') console.log('login卸载')

View File

@ -8,7 +8,7 @@
</view> </view>
<view class="content-container"> <view class="content-container">
<container-loading loadingState="{{loadingState}}" style="height: 85vh;" bindrefresh="doRefreshList"> <container-loading loadingState="{{loadingState}}" style="height: 85vh;" bindrefresh="doRefreshList">
<scroll-view scroll-y="{{true}}" style="height: 85vh;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='30'> <scroll-view scroll-y="{{true}}" style="height: 85vh;padding-bottom: 40px;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='30'>
<view class="order-box"> <view class="order-box">
<block wx:for="{{contactList}}" wx:key="index"> <block wx:for="{{contactList}}" wx:key="index">
<view class="order-item"> <view class="order-item">
@ -41,19 +41,19 @@
<view class="form-box"> <view class="form-box">
<view class="form-item"> <view class="form-item">
<view class="form-item-title">姓名</view> <view class="form-item-title">姓名</view>
<input value="{{contactName}}" placeholder="请输入联系人姓名" class="form-item-content" bindinput="inputContactName" /> <input adjust-position="{{true}}" cursor-spacing="{{50}}" value="{{contactName}}" placeholder="请输入联系人姓名" class="form-item-content" bindinput="inputContactName" />
</view> </view>
<view class="form-item"> <view class="form-item">
<view class="form-item-title">联系电话</view> <view class="form-item-title">联系电话</view>
<input value="{{contactPhone}}" placeholder="请输入联系电话" class="form-item-content" bindinput="inputContactPhone" /> <input adjust-position="{{true}}" cursor-spacing="{{50}}" value="{{contactPhone}}" placeholder="请输入联系电话" class="form-item-content" bindinput="inputContactPhone" />
</view> </view>
<view class="form-item"> <view class="form-item">
<view class="form-item-title no-after">联系邮箱</view> <view class="form-item-title no-after">联系邮箱</view>
<input value="{{contactEmail}}" placeholder="请输入邮箱" class="form-item-content" bindinput="inputContactEmail" /> <input adjust-position="{{true}}" cursor-spacing="{{50}}" value="{{contactEmail}}" placeholder="请输入邮箱" class="form-item-content" bindinput="inputContactEmail" />
</view> </view>
<view class="form-item"> <view class="form-item">
<view class="form-item-title no-after">公司</view> <view class="form-item-title no-after">公司</view>
<input value="{{contactCompany}}" placeholder="请输入公司名称" class="form-item-content" bindinput="inputContactCompany" /> <input adjust-position="{{true}}" cursor-spacing="{{50}}" value="{{contactCompany}}" placeholder="请输入公司名称" class="form-item-content" bindinput="inputContactCompany" />
</view> </view>
</view> </view>
</view> </view>